<template>
  <div class="dashboard-container">
    <div v-loading="downloadLoadingZ" class="app-container">
      <!-- 自定义组件，标题 -->
      <!-- <PageTitle :show-before="true">
        <template v-slot:before>
          <h2>企业管理</h2>
        </template>
        <template v-slot:after>
          
        </template>
      </PageTitle> -->
      <el-tabs type="border-card" v-model="activeName">
        <el-tab-pane label="全部客户" name="1">
          <!-- 搜索筛选 -->
          <el-row :gutter="20" style="margin-top: 20px">
            <el-col :span="3">
              <el-select
                v-model="enterpriseListQuery.audit"
                placeholder="请选择审核状态"
                clearable
                @change="handleAuditChange"
              >
                <el-option
                  v-for="item in auditList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-col>
            <el-col :span="3">
              <el-select
                v-model="enterpriseListQuery.isDisplay"
                placeholder="请选择显示状态"
                clearable
                @change="handleDisplayChange"
              >
                <el-option
                  v-for="item in displayDisplay"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-col>
            <el-col :span="3">
              <el-cascader
                clearable
                v-model="enterpriseListQuery.district"
                :options="jobAreaList"
                @change="handleAreaChange"
                :props="{
                  checkStrictly: true, // 允许选择任意一级
                  expandTrigger: 'hover', // 鼠标悬停时展开子菜单
                  value: 'value',
                  label: 'label',
                  children: 'children',
                }"
                placeholder="请选择意向地区"
              ></el-cascader>
            </el-col>
            <el-col :span="3">
              <el-select
                v-model="enterpriseListQuery.trade"
                placeholder="请选择所属行业"
                clearable
                @change="handleTradeChange"
              >
                <el-option
                  v-for="item in selCategoryTradeLists"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                >
                </el-option>
              </el-select>
            </el-col>
            <el-col :span="7">
              <el-row :gutter="10" type="flex">
                <el-select
                  style="width: 200px"
                  v-model="enterpriseListQuery.keyType"
                  placeholder="企业名称"
                  clearable
                  @change="handleKeyTypeChange"
                >
                  <el-option
                    v-for="item in weChatList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
                <el-input
                  clearable
                  v-model="enterpriseListQuery.keyword"
                  @keyup.enter.native="handlesearch"
                  type="text"
                  placeholder="请输入搜索内容"
                />
                <el-button
                  type="primary"
                  icon="el-icon-search"
                  @click="handlesearch"
                ></el-button>
              </el-row>
            </el-col>
            <!-- <el-col :span="3">
              <el-button
                class="filter-item"
                size="medium"
                style="margin-left: 10px"
                type="primary"
                icon="el-icon-edit"
                :disabled="!checkPermission('companyUser-tong')"
                @click="getHRCompany"
                >同步企业数据</el-button
              >
            </el-col> -->
          </el-row>
          <!-- 数据表 -->
          <el-table
            ref="multipleTable"
            v-loading="downloadLoading"
            border
            :header-cell-style="{
              background: '#f4f7fa',
              color: 'black',
              fontWeight: '500',
            }"
            :data="enterpriseList"
            max-height="600px"
            style="margin-top: 20px"
            @sort-change="handleSortChange"
            @selection-change="handleSelectionChange"
          >
            <el-table-column type="selection" width="55" />
            <el-table-column
              label="ID"
              prop="id"
              sortable="custom"
              width="60"
              fixed
            >
            </el-table-column>
            <!-- 添加营业执照缩略图列 -->
            <el-table-column label="营业执照" width="80" align="center" fixed>
              <template slot-scope="scope">
                <el-image
                  style="width: 50px; height: 50px; cursor: pointer"
                  :src="scope.row.companyAuth?.licenseUrl"
                  fit="cover"
                  @click="companyClick(scope.row.companyAuth?.licenseUrl)"
                >
                  <div slot="error" class="image-slot">
                    <i class="el-icon-picture-outline"></i>
                  </div>
                </el-image>
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="企业名称"
              prop="companyname"
              fixed
              width="400"
            >
              <template slot-scope="scope">
                {{ scope.row.companyname }}
                <span
                  style="color: blue; cursor: pointer"
                  @click="companyClick(scope.row.companyAuth?.licenseUrl)"
                  >[查看]</span
                >
              </template>
            </el-table-column>
            <el-table-column
              label="审核状态"
              prop="audit"
              width="140"
              align="center"
            >
              <template slot-scope="{ row }">
                <el-tag
                  :type="getStatusType(row.audit)"
                  v-if="row.auditId !== 3"
                >
                  {{ row.audit | auditStatus }}
                </el-tag>
                <el-tag type="info" v-else>未认证</el-tag>
              </template>
            </el-table-column>
            <el-table-column
              label="显示状态"
              prop="display"
              width="140"
              align="center"
            >
              <template slot-scope="{ row }">
                <el-tag :type="row.isDisplay ? 'success' : 'danger'">
                  {{ row.display }}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column
              label="所属行业"
              prop="tradeTxt"
              width="150"
              align="center"
            >
              <template slot-scope="{ row }">
                {{ row.tradeTxt }}
              </template>
            </el-table-column>
            <el-table-column
              label="所在地区"
              prop="districtTxt"
              width="100"
              align="center"
            />
            <el-table-column
              label="客户等级"
              prop="lifeCycleTxt"
              width="140"
              align="center"
            />
            <el-table-column
              label="联系人"
              prop="contact"
              width="100"
              align="center"
            />
            <el-table-column
              label="企业联系方式"
              prop="mobile"
              width="140"
              align="center"
            >
            </el-table-column>
            <el-table-column
              label="会员联系方式"
              prop="mobile"
              width="160"
              align="center"
            >
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              fixed="right"
              width="200"
            >
              <template slot-scope="{ row }">
                <el-button
                  icon="el-icon-edit"
                  type="primary"
                  size="mini"
                  @click="addAdminOpen(row)"
                  >查看</el-button
                >
              </template>
            </el-table-column>
            <el-table-column align="center" prop="isExpire" label="在招职位">
            </el-table-column>
            <el-table-column
              align="center"
              prop="jobApplyCount"
              label="收到简历"
            >
            </el-table-column>
            <el-table-column
              align="center"
              prop="refreshtime"
              label="刷新时间"
              width="170"
              sortable="custom"
              :sort-orders="['ascending', 'descending']"
            >
              <template slot-scope="{ row }">
                <i class="el-icon-time"></i> {{ row.refreshtime | dateFormat }}
              </template>
            </el-table-column>
            <el-table-column
              prop="addtime"
              label="注册时间"
              width="170"
              sortable="custom"
            >
              <template slot-scope="{ row }">
                <template v-if="row.addtime">
                  <i class="el-icon-time"></i>
                  {{ row.addtime | dateFormat }}
                </template>
                <template v-else>-</template>
              </template>
            </el-table-column>
            <el-table-column
              prop="lastLoginTime"
              label="登录时间"
              width="170"
              sortable="custom"
            >
              <template slot-scope="{ row }">
                <template v-if="row.lastLoginTime">
                  <i class="el-icon-time"></i>
                  {{ row.lastLoginTime | dateFormat }}
                </template>
                <template v-else>-</template>
              </template>
            </el-table-column>
          </el-table>
          <!-- 分页 -->
          <el-row type="flex" justify="space-between" style="margin-top: 20px">
            <el-col :span="12">
              <div class="">
                <el-button type="primary" size="small" @click="toggleSelection"
                  >全选/反选</el-button
                >
                <el-button type="warning" size="small" @click="handleAuthClick">
                  审核
                </el-button>
                <el-button type="primary" size="small" @click="handleDisplay">
                  显示
                </el-button>
                <el-button
                  type="primary"
                  size="small"
                  @click="handleRefJobClick"
                >
                  刷新职位
                </el-button>
                <el-button type="primary" size="small" @click="exportAllClick"
                  >全部导出</el-button
                >
              </div>
            </el-col>
            <el-col :span="12">
              <el-pagination
                background
                @size-change="handleSizeQyChange"
                @current-change="handleCurrentQyChange"
                :current-page="enterpriseListQuery.page"
                :page-size="enterpriseListQuery.pagesize"
                :page-sizes="[10, 20, 30, 50]"
                layout="total, sizes, prev, pager, next, jumper"
                :total="enterpriseTotal"
              >
              </el-pagination>
            </el-col>
          </el-row>
        </el-tab-pane>
        <el-tab-pane label="企业风采" name="2">
          <el-row :gutter="10">
            <el-col :span="3">
              <el-select
                v-model="listQuery.keyType"
                placeholder="公司名称"
                @change="handleCompanyTypeChange"
                clearable
              >
                <el-option
                  v-for="item in companyTypeList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-col>
            <el-col :span="3">
              <el-select
                v-model="listQuery.audit"
                placeholder="不限审核状态"
                @change="handleAuditFcChange"
                clearable
              >
                <el-option
                  v-for="item in audiFctList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-col>
            <el-col :span="5">
              <el-input
                v-model="listQuery.keyword"
                placeholder="请输入搜索内容"
                @keyup.enter.native="handleAddContact"
              >
                <template slot="append">
                  <el-button type="primary" @click="handleAddContact">
                    <i class="el-icon-search"></i>
                  </el-button>
                </template>
              </el-input>
            </el-col>
          </el-row>
          <div class="check-box">
            <div class="check-list">
              <div
                role="group"
                aria-label="checkbox-group"
                class="el-checkbox-group"
              >
                <div
                  class="check-item"
                  v-for="item in styleArray"
                  :key="item.id"
                >
                  <div class="el-checkbox">
                    <el-checkbox
                      class="el-checkbox__input"
                      label=""
                      v-model="item.isChecked"
                      @change="handleAuditCheckboxChange(item)"
                    ></el-checkbox>
                    <el-tooltip
                      class="item"
                      effect="dark"
                      :content="item.companyname"
                      placement="top"
                    >
                      <div class="substring">{{ item.companyname }}</div>
                    </el-tooltip>
                  </div>
                  <!-- <div class="com-img">
                    <img :src="item.imgSrc" alt="" />
                  </div> -->
                  <el-image
                    style="width: 100px; height: 100px"
                    :src="item.imgSrc"
                    :fit="fit"
                    class="el-image"
                  ></el-image>
                  <div class="com-status">
                    审核状态：
                    <span v-if="item.audit === 0" style="color: #ff5400"
                      >待审核</span
                    >
                    <span v-else-if="item.audit === 1" style="color: #00c600"
                      >已通过</span
                    >
                    <span v-else style="color: #ff0000">未通过</span>
                  </div>
                  <div class="com-oprate">
                    <span class="text" @click="examine(item)">审核</span>
                    <!-- <span class="text txt">|</span> -->
                    <span>|</span>
                    <span class="text" @click="btnDelStyle(item)">删除</span>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <el-row :gutter="10" type="flex" justify="space-between">
            <el-col :span="6">
              <!-- <el-button type="primary" size="small">全选/反选</el-button> -->
              <el-button type="warning" size="small" @click="handleBatchAudit"
                >批量审核</el-button
              >
            </el-col>
            <el-col :span="12">
              <el-pagination
                background
                @size-change="handleSizeElegantChange"
                @current-change="handleCurrentElegantChange"
                :page-size="listQuery.pagesize"
                :current-page="listQuery.page"
                :page-sizes="[10, 20, 30, 50]"
                layout="total, sizes, prev, pager, next, jumper"
                :total="elegantTotal"
              >
              </el-pagination>
            </el-col>
          </el-row>
        </el-tab-pane>
      </el-tabs>
    </div>
    <RightPanel ref="panel" :click-not-close="true" :width="75">
      <div class="base">
        <div class="logo"><img alt="" :src="companyContent.logoUrl" /></div>
        <div class="info">
          <div class="title">
            <div class="name">{{ companyContent.companyname }}</div>
            <!-- <div class="qcc_box">
              <a href="" target="_blank"><img src="@/assets/common/aiqicha.980bad00.png" alt=""></a>
            </div> -->
          </div>
          <div class="details">
            <el-row class="line">
              <el-col :span="8">
                <label class="line_label">企业认证：</label>
                <el-tag
                  :type="getStatusType(companyContent.audit)"
                  v-if="companyContent.auditId !== 3"
                >
                  {{ companyContent.audit | auditStatus }}
                </el-tag>
                <el-tag type="info" v-else> 未认证 </el-tag>
              </el-col>
              <el-col :span="8">
                <label class="line_label">单位类型：</label>
                <!-- <span class="text"> {{ company.credit_code }} </span> -->
                <span class="text">{{ companyContent.typeName }}</span>
              </el-col>
              <el-col :span="8">
                <label class="line_label">显示状态：</label>
                <el-tag type="success" v-if="companyContent.isDisplay === 1"
                  >显示中</el-tag
                >
                <el-tag type="danger" v-else>未显示</el-tag>
                <!-- <el-tag v-if="company.is_practice === 0" type="info"
                  >未认证</el-tag
                >
                <el-tag v-if="company.is_practice === 1" type="success"
                  >已认证</el-tag
                >
                <el-tag v-if="company.is_practice === 2" type="danger"
                  >未通过</el-tag
                >
                <el-tag v-if="company.is_practice === 3" type="primary"
                  >审核中</el-tag
                >
                <el-tag v-if="company.is_practice === 4" type="warning"
                  >已退出</el-tag
                > -->
              </el-col>
            </el-row>
            <el-row class="line">
              <el-col :span="8">
                <label class="line_label">联系人：</label>
                <span class="text">
                  {{ companyContent.contact }}
                </span>
              </el-col>
              <el-col :span="8">
                <label class="line_label">行业类型：</label>
                <span class="text"> {{ companyContent.tradeTxt }} </span>
              </el-col>
              <el-col :span="8">
                <label class="line_label">所属地区：</label>
                <!-- <span class="text"
                  >{{ company.district1_name }}{{ company.district2_name
                  }}{{ company.district_name }}</span
                > -->
                <span class="text">{{ companyContent.districtTxt }}</span>
              </el-col>
            </el-row>
          </div>
        </div>
      </div>
      <div class="tab_box">
        <el-tabs v-model="activeViewName" @tab-click="handleClick">
          <el-tab-pane label="企业详情" name="1">
            <div class="clientInfo_wrapper">
              <el-row>
                <el-col :span="13">
                  <div class="tables">
                    <div class="title_t">企业资料</div>
                    <div class="table_content">
                      <el-form
                        ref="ruleForm"
                        :model="companyContent"
                        label-width="140px"
                      >
                        <el-form-item label="注册资金" prop="registered">
                          <div>
                            <el-input
                              style="width: 80%"
                              disabled
                              placeholder="请输入内容"
                              v-model="companyContent.registered"
                            >
                              <template slot="append">万人民币</template>
                            </el-input>
                          </div>
                        </el-form-item>
                        <el-form-item label="企业性质" prop="address">
                          <el-input
                            v-model="companyContent.typeName"
                            style="width: 80%"
                            disabled
                          />
                        </el-form-item>
                        <el-form-item label="所属行业" prop="address">
                          <el-input
                            v-model="companyContent.tradeTxt"
                            placeholder=""
                            style="width: 80%"
                            disabled
                          ></el-input>
                        </el-form-item>
                        <!-- <el-form-item label="公司网址" prop="credit_code">
                          <el-input
                            v-model="info.website"
                            style="width: 80%"
                            disabled
                          />
                        </el-form-item> -->
                        <el-form-item label="企业福利" prop="tagTextArr">
                          <div class="tags-container">
                            <el-tag
                              v-for="(tag, index) in companyContent.tagTextArr"
                              :key="index"
                            >
                              {{ tag }}
                            </el-tag>
                          </div>
                        </el-form-item>
                        <el-form-item label="联系地址" prop="address">
                          <el-input
                            v-model="companyContent.address"
                            style="width: 80%"
                            disabled
                          />
                        </el-form-item>
                        <el-form-item label="公司介绍" prop="content">
                          <el-input
                            v-model="companyContent.content"
                            type="textarea"
                            :rows="10"
                            style="width: 80%"
                            disabled
                          />
                        </el-form-item>
                      </el-form>
                    </div>
                  </div>
                </el-col>
                <!-- <el-col :span="11">
                  <div class="tables">
                    <div class="title_t">企业风采</div>
                    <div class="img_box">
                      <ImagesListUpload ref="img_list" :is-true="true" />
                    </div>
                  </div>
                </el-col> -->
              </el-row>
            </div>
          </el-tab-pane>
          <el-tab-pane label="联系方式" name="2">
            <div class="clientInfo_wrapper">
              <el-row>
                <el-col :span="13">
                  <div class="tables">
                    <div class="title_t">联系方式</div>
                    <div class="table_content">
                      <el-form
                        ref="ruleForm"
                        :model="contact"
                        label-width="100px"
                      >
                        <el-form-item label="联系人" prop="contact">
                          <el-input
                            v-model="contact.contact"
                            style="width: 80%"
                            disabled
                          />
                        </el-form-item>
                        <el-form-item label="联系电话" prop="mobile">
                          <el-input
                            v-model="contact.mobile"
                            style="width: 80%"
                            disabled
                          />
                        </el-form-item>
                        <el-form-item label="联系微信" prop="weixin">
                          <el-input
                            v-model="contact.weixin"
                            style="width: 80%"
                            disabled
                          />
                        </el-form-item>
                        <el-form-item label="联系固话" prop="telephone">
                          <el-input
                            v-model="contact.telephone"
                            style="width: 80%"
                            disabled
                          />
                        </el-form-item>
                        <el-form-item label="联系邮箱" prop="email">
                          <el-input
                            v-model="contact.email"
                            style="width: 80%"
                            disabled
                          />
                        </el-form-item>
                      </el-form>
                    </div>
                  </div>
                </el-col>
              </el-row>
            </div>
          </el-tab-pane>

          <el-tab-pane label="客户详情" name="4">
            <!-- 客户详情表单 -->
            <div class="detail-form">
              <el-form label-width="100px" class="detail-form-body">
                <el-form-item label="企业账号:">
                  <!-- <span class="value-text">{{
                    customerDetails.companyAccount
                  }}</span> -->
                  <el-input
                    v-model="customerDetails.companyAccount"
                    disabled
                    style="width: 400px"
                  />
                </el-form-item>

                <el-form-item label="会员手机:">
                  <!-- <span class="value-text">{{
                    customerDetails.memberMobile
                  }}</span> -->
                  <el-input
                    v-model="customerDetails.memberMobile"
                    disabled
                    style="width: 400px"
                  />
                </el-form-item>

                <el-form-item label="企业手机:">
                  <!-- <span class="value-text">{{
                    customerDetails.companyMobile
                  }}</span> -->
                  <el-input
                    v-model="customerDetails.companyMobile"
                    disabled
                    style="width: 400px"
                  />
                </el-form-item>

                <el-form-item label="显示状态:">
                  <!-- <span class="value-text success-text">{{
                    customerDetails.isDisplay ? "显示中" : "未显示"
                  }}</span> -->
                  <div class="tags-container">
                    <el-tag v-if="customerDetails.isDisplay" type="success"
                      >显示中</el-tag
                    >
                    <el-tag v-else type="danger">未显示</el-tag>
                  </div>
                </el-form-item>

                <el-form-item label="企业认证:">
                  <!-- <span
                    class="value-text success-text"
                    v-if="customerDetails.audit === 0"
                    >待审核</span
                  >
                  <span
                    class="value-text success-text"
                    v-else-if="customerDetails.audit === 1"
                    >已认证</span
                  >
                  <span class="value-text success-text" v-else>未通过</span> -->
                  <div class="tags-container">
                    <el-tag
                      :type="getStatusType(customerDetails.audit)"
                      v-if="customerDetails.auditId !== 3"
                    >
                      {{ customerDetails.audit | auditStatus }}
                    </el-tag>
                    <el-tag v-else>未认证</el-tag>
                  </div>
                </el-form-item>
              </el-form>
            </div>
          </el-tab-pane>

          <el-tab-pane label="企业资料" name="5">
            <div class="company-info">
              <!-- <h2 class="main-title">企业资料</h2> -->
              <div class="info-section">
                <h3 class="main-title">企业信息</h3>
                <el-row :gutter="10">
                  <el-col :span="12">
                    <el-form
                      :model="enterpriseListForm"
                      :rules="companyRules"
                      ref="companyForm"
                      label-position="left"
                      class="company-form"
                      label-width="80px"
                    >
                      <el-form-item label="企业地址" prop="address">
                        <el-input
                          v-model="enterpriseListForm.address"
                          placeholder="请输入企业地址"
                        ></el-input>
                      </el-form-item>
                      <el-form-item label="联系人" prop="contact">
                        <el-input
                          v-model="enterpriseListForm.contact"
                          placeholder="请输入联系人姓名"
                        ></el-input>
                      </el-form-item>
                      <el-form-item label="手机号" prop="contactMobile">
                        <el-input
                          v-model="enterpriseListForm.contactMobile"
                          placeholder="请输入手机号"
                        ></el-input>
                      </el-form-item>
                      <el-form-item label="企业性质" prop="nature">
                        <el-select
                          v-model="enterpriseListForm.nature"
                          placeholder="民营"
                        >
                          <el-option
                            v-for="item in enterpriseXzList"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id"
                          >
                          </el-option>
                        </el-select>
                      </el-form-item>
                      <el-form-item label="企业规模" prop="scale">
                        <el-select
                          v-model="enterpriseListForm.scale"
                          placeholder="请选择企业规模"
                        >
                          <el-option
                            v-for="item in enterpriseGmList"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id"
                          >
                          </el-option>
                        </el-select>
                      </el-form-item>
                      <el-form-item label="所属行业" prop="trade">
                        <el-select
                          v-model="enterpriseListForm.trade"
                          placeholder="请选择所属行业"
                          clearable
                        >
                          <el-option
                            v-for="item in selCategoryTradeLists"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id"
                          >
                          </el-option>
                        </el-select>
                      </el-form-item>
                      <el-form-item label="企业地区">
                        <el-cascader
                          style="width: 100%"
                          clearable
                          v-model="enterpriseListForm.district"
                          :options="jobAreaList"
                          @change="handleQyInfoChange"
                          :props="{
                            checkStrictly: true, // 允许选择任意一级
                            expandTrigger: 'hover', // 鼠标悬停时展开子菜单
                            value: 'value',
                            label: 'label',
                            children: 'children',
                          }"
                          placeholder="请选择意向地区"
                        ></el-cascader>
                      </el-form-item>
                      <el-form-item label="注册资金" prop="registered">
                        <el-input
                          v-model="enterpriseListForm.registered"
                          placeholder="请输入内容"
                        >
                          <template slot="append">万人民币</template>
                        </el-input>
                      </el-form-item>
                      <el-form-item label="企业福利" prop="tagTextArr">
                        <el-row :gutter="10" type="flex">
                          <el-select
                            v-model="enterpriseListForm.tagTextArr"
                            multiple
                            placeholder="请选择企业福利"
                            :multiple-limit="10"
                          >
                            <el-option
                              v-for="item in tags"
                              :key="item.id"
                              :label="item.name"
                              :value="item.id"
                            >
                            </el-option>
                          </el-select>
                          <el-button
                            type="text"
                            class="clear-btn"
                            @click="clearTags"
                            v-if="
                              companyContent.tagTextArr &&
                              companyContent.tagTextArr.length
                            "
                          >
                            清空
                          </el-button>
                        </el-row>
                      </el-form-item>
                      <el-form-item label="企业介绍" prop="content">
                        <el-input
                          v-model="enterpriseListForm.content"
                          type="textarea"
                          :rows="7"
                          placeholder="请输入企业介绍"
                        ></el-input>
                      </el-form-item>
                      <el-form-item>
                        <el-button type="primary" @click="saveEnterpriseList"
                          >保存</el-button
                        >
                      </el-form-item>
                    </el-form>
                  </el-col>
                </el-row>
              </div>
            </div>
          </el-tab-pane>

          <el-tab-pane label="联系人" name="6">
            <div class="contact-cards">
              <!-- 企业联系人卡片 -->
              <div class="card">
                <div class="card-header">
                  <span class="name">{{ contactsList.companyContent }}</span>
                  <el-tag type="warning" size="small" effect="plain">
                    企业联系方式
                  </el-tag>
                </div>

                <div class="contact-item">
                  <span class="phone">{{ contactsList.companyMobile }}</span>
                  <i class="el-icon-chat-dot-round whatsapp-icon"></i>
                </div>

                <div class="contact-item">
                  <span class="label">座机：</span>
                  <span class="value">-</span>
                </div>

                <div class="contact-item">
                  <span class="label">QQ：</span>
                  <span class="value">-</span>
                </div>

                <div class="contact-item">
                  <span class="label">邮箱：</span>
                  <span class="value">-</span>
                </div>
              </div>

              <!-- 会员联系人卡片 -->
              <div class="card">
                <div class="card-header">
                  <span class="name">{{ contactsList.memberContent }}</span>
                  <el-tag type="success" size="small" effect="plain">
                    会员联系方式
                  </el-tag>
                </div>

                <div class="contact-item">
                  <span class="phone">{{ contactsList.memberMobile }}</span>
                  <i class="el-icon-chat-dot-round whatsapp-icon"></i>
                </div>

                <div class="contact-item">
                  <span class="label">座机：</span>
                  <span class="value">-</span>
                </div>

                <div class="contact-item">
                  <span class="label">QQ：</span>
                  <span class="value">-</span>
                </div>

                <div class="contact-item">
                  <span class="label">邮箱：</span>
                  <span class="value">-</span>
                </div>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="在招职位" name="7">
            <div class="jobs-wrapper">
              <!-- 顶部按钮组 -->
              <div class="button-group">
                <el-button-group>
                  <el-button
                    :type="currentJobType === 'recruiting' ? 'primary' : ''"
                    @click="handleJobTypeChange('recruiting')"
                  >
                    招聘中职位
                  </el-button>
                  <el-button
                    :type="currentJobType === 'reviewing' ? 'primary' : ''"
                    @click="handleJobTypeChange('reviewing')"
                  >
                    审核中职位
                  </el-button>
                  <el-button
                    :type="currentJobType === 'offline' ? 'primary' : ''"
                    @click="handleJobTypeChange('offline')"
                  >
                    已下线职位
                  </el-button>
                </el-button-group>
              </div>

              <!-- 表格部分 -->
              <div class="table-container">
                <el-table
                  :data="vacancyList"
                  style="width: 100%"
                  v-loading="jobsLoading"
                >
                  <el-table-column type="selection" width="55" />
                  <el-table-column
                    label="职位名称"
                    prop="jobname"
                    min-width="150"
                  >
                    <template slot-scope="scope">
                      <el-link
                        type="primary"
                        :href="scope.row.jobLinkUrlWeb"
                        target="_blank"
                        >{{ scope.row.jobname }}</el-link
                      >
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="职位要求"
                    prop="experienceText"
                    min-width="200"
                  />
                  <el-table-column label="薪资待遇" prop="salary" width="120">
                    <template slot-scope="scope">
                      {{ scope.row.minWage }} - {{ scope.row.maxWage }}
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="招聘人数"
                    prop="count"
                    width="100"
                    align="center"
                  />
                  <el-table-column
                    label="联系方式"
                    prop="contact"
                    width="120"
                  />
                  <el-table-column
                    label="刷新时间"
                    prop="refreshTime"
                    width="160"
                  />
                  <el-table-column label="职位状态" width="100">
                    <template slot-scope="scope">
                      <div>{{ scope.row.jobStatusCn }}</div>
                      <div>{{ scope.row.isDisplay ? "显示中" : "未显示" }}</div>
                      <div>
                        {{
                          scope.row.audit == 0
                            ? "待审核"
                            : scope.row.audit == 1
                            ? "已认证"
                            : "未通过"
                        }}
                      </div>
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="收到简历"
                    prop="resumeCount"
                    width="100"
                    align="center"
                  >
                    <template slot-scope="scope">
                      <div>收到{{ socpe.row.resumeAll }}份简历</div>
                      <div>{{ scope.row.resumeNolook }}次浏览</div>
                    </template>
                  </el-table-column>
                </el-table>

                <!-- 分页 -->
                <div
                  class="pagination-container"
                  :class="`${currentJobType}-pagination`"
                >
                  <el-pagination
                    background
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="jobsQuery.page"
                    :page-sizes="[10, 20, 30, 50]"
                    :page-size="jobsQuery.pageSize"
                    layout="prev, pager, next"
                    :total="totalJobs"
                  >
                  </el-pagination>
                </div>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="招聘动态" name="8">
            <div class="recruitment-wrapper">
              <!-- 顶部按钮组 -->
              <div class="button-group">
                <el-button-group>
                  <el-button
                    :type="currentRecruitType === 'received' ? 'primary' : ''"
                    @click="handleRecruitTypeChange('received')"
                  >
                    收到投递
                  </el-button>
                  <el-button
                    :type="currentRecruitType === 'downloaded' ? 'primary' : ''"
                    @click="handleRecruitTypeChange('downloaded')"
                  >
                    主动下载
                  </el-button>
                  <el-button
                    :type="currentRecruitType === 'viewed' ? 'primary' : ''"
                    @click="handleRecruitTypeChange('viewed')"
                  >
                    近期查看
                  </el-button>
                  <el-button
                    :type="
                      currentRecruitType === 'positionViewed' ? 'primary' : ''
                    "
                    @click="handleRecruitTypeChange('positionViewed')"
                  >
                    职位被查看
                  </el-button>
                </el-button-group>
              </div>

              <!-- 表格容器 -->
              <div class="table-container">
                <!-- 收到投递表格 -->
                <el-table
                  v-show="currentRecruitType === 'received'"
                  :data="recruitmentNewsList"
                  v-loading="recruitmentLoading"
                  style="width: 100%"
                >
                  <el-table-column label="简历名称" min-width="180">
                    <template slot-scope="scope">
                      <div>
                        <el-link type="primary">
                          {{ scope.row.fullname }}
                        </el-link>
                      </div>
                      <div
                        style="color: #666; font-size: 13px; margin-top: 5px"
                      >
                        {{ scope.row.sexText }} / {{ scope.row.age }}岁 /
                        {{ scope.row.educationText }} /
                        {{ scope.row.experienceText }}经验
                      </div>
                    </template>
                  </el-table-column>

                  <el-table-column label="求职意向" min-width="200">
                    <template slot-scope="scope">
                      <div>
                        <!-- <div style="margin-bottom: 5px">
                          <span style="color: #666">匹配度：</span>
                          <span style="color: #409eff">{{
                            scope.row.highQuality ? "100%" : "80%"
                          }}</span>
                        </div> -->
                        <div>
                          <span style="color: #666">意向职位：</span>
                          {{ scope.row.jobname }}
                        </div>
                        <div style="margin-bottom: 5px">
                          <span style="color: #666">意向地区：</span>
                          {{ scope.row.intentionDistrict }}
                        </div>
                        <div>
                          <span style="color: #666">意向类型：</span>
                          {{ scope.row.intentionJobs }}
                        </div>
                        <div>
                          <span style="color: #666">意向性质：</span>
                          {{ scope.row.intentionNature }}
                        </div>
                        <div>
                          <span style="color: #666">意向薪资：</span>
                          {{ scope.row.intentionWage }}
                        </div>
                      </div>
                    </template>
                  </el-table-column>

                  <el-table-column
                    prop="recentWork"
                    label="最近工作"
                    align="center"
                    show-overflow-tooltip
                  >
                    <template slot-scope="scope">
                      {{ scope.row.recentWork }}
                    </template>
                  </el-table-column>

                  <el-table-column label="状态" min-width="120">
                    <template slot-scope="scope">
                      <el-link type="primary">
                        {{ scope.row.currentText }}
                      </el-link>
                    </template>
                  </el-table-column>

                  <el-table-column label="是否查看" width="100">
                    <template slot-scope="scope">
                      <el-tag
                        :type="scope.row.isLook === 1 ? 'success' : 'info'"
                      >
                        {{ scope.row.isLook === 1 ? "已查看" : "未查看" }}
                      </el-tag>
                    </template>
                  </el-table-column>

                  <!-- <el-table-column label="是否面试" width="100">
                    <template slot-scope="scope">
                      <el-tag
                        :type="
                          scope.row.handleStatus === 1 ? 'success' : 'info'
                        "
                      >
                        {{ scope.row.handleStatus === 1 ? "是" : "否" }}
                      </el-tag>
                    </template>
                  </el-table-column> -->

                  <el-table-column label="投递时间" width="160">
                    <template slot-scope="scope">
                      {{ scope.row.addtime | dateFormat }}
                    </template>
                  </el-table-column>

                  <!-- <el-table-column label="操作" width="100" fixed="right">
                    <template slot-scope="scope">
                      <el-link
                        type="primary"
                        @click="handleResumeDetail(scope.row)"
                      >
                        查看简历
                      </el-link>
                    </template>
                  </el-table-column> -->
                </el-table>

                <!-- 主动下载表格 -->
                <el-table
                  v-show="currentRecruitType === 'downloaded'"
                  :data="downloadList"
                  v-loading="downloadLoading"
                  style="width: 100%"
                >
                  <el-table-column label="简历名称" min-width="180">
                    <template slot-scope="scope">
                      <div>
                        <el-link type="primary">
                          {{ scope.row.fullname }}
                        </el-link>
                      </div>
                      <div
                        style="color: #666; font-size: 13px; margin-top: 5px"
                      >
                        {{ scope.row.sexText }} / {{ scope.row.age }} /
                        {{ scope.row.educationText }} /
                        {{ scope.row.experienceText }}
                      </div>
                    </template>
                  </el-table-column>

                  <el-table-column label="求职意向" min-width="200">
                    <template slot-scope="scope">
                      <div>
                        <div style="margin-bottom: 5px">
                          <span style="color: #666">意向地区：</span>
                          {{ scope.row.intentionDistrict }}
                        </div>
                        <div>
                          <span style="color: #666">意向职位：</span>
                          {{ scope.row.intentionJobs }}
                        </div>
                      </div>
                    </template>
                  </el-table-column>

                  <el-table-column label="下载时间" width="160">
                    <template slot-scope="scope">
                      {{ scope.row.addtime | dateFormat }}
                    </template>
                  </el-table-column>

                  <!-- <el-table-column label="操作" width="100" fixed="right">
                    <template slot-scope="scope">
                      <el-link
                        type="primary"
                        @click="handleResumeDetail(scope.row)"
                      >
                        查看简历
                      </el-link>
                    </template>
                  </el-table-column> -->
                </el-table>

                <!-- 近期查看表格 -->
                <el-table
                  v-show="currentRecruitType === 'viewed'"
                  :data="recentlyViewedList"
                  v-loading="viewedLoading"
                  style="width: 100%"
                >
                  <el-table-column label="简历名称" min-width="180">
                    <template slot-scope="scope">
                      <div>
                        <el-link type="primary" target="_blank">
                          {{ scope.row.fullname }}
                        </el-link>
                      </div>
                      <div
                        style="color: #666; font-size: 13px; margin-top: 5px"
                      >
                        {{ scope.row.sexText }} / {{ scope.row.age }}岁 /
                        {{ scope.row.educationText }} /
                        {{ scope.row.experienceText }}
                      </div>
                    </template>
                  </el-table-column>

                  <el-table-column label="求职意向" min-width="200">
                    <template slot-scope="scope">
                      <div>
                        <div style="margin-bottom: 5px">
                          <span style="color: #666">意向地区：</span>
                          {{ scope.row.intentionDistrict }}
                        </div>
                        <div>
                          <span style="color: #666">意向职位：</span>
                          {{ scope.row.intentionJobs }}
                        </div>
                      </div>
                    </template>
                  </el-table-column>

                  <el-table-column label="浏览时间" width="160">
                    <template slot-scope="scope">
                      {{ scope.row.addtime | dateFormat }}
                    </template>
                  </el-table-column>

                  <!-- <el-table-column label="操作" width="100" fixed="right">
                    <template slot-scope="scope">
                      <el-link
                        type="primary"
                        :href="scope.row.resumeLinkUrlWeb"
                        target="_blank"
                      >
                        查看简历
                      </el-link>
                    </template>
                  </el-table-column> -->
                </el-table>

                <!-- 被查看表格 -->
                <el-table
                  v-show="currentRecruitType === 'positionViewed'"
                  :data="beingViewedList"
                  v-loading="downloadLoading"
                  style="width: 100%"
                >
                  <el-table-column label="简历名称" min-width="180">
                    <template slot-scope="scope">
                      <div>
                        <el-link type="primary" target="_blank">
                          {{ scope.row.fullname }}
                        </el-link>
                      </div>
                      <div
                        style="color: #666; font-size: 13px; margin-top: 5px"
                      >
                        {{ scope.row.sexText }} / {{ scope.row.age }}岁 /
                        {{ scope.row.educationText }} /
                        {{ scope.row.experienceText }}
                      </div>
                    </template>
                  </el-table-column>

                  <el-table-column label="求职意向" min-width="200">
                    <template slot-scope="scope">
                      <div>
                        <div style="margin-bottom: 5px">
                          <span style="color: #666">意向地区：</span>
                          {{ scope.row.intentionDistrict }}
                        </div>
                        <div>
                          <span style="color: #666">意向职位：</span>
                          {{ scope.row.intentionJobs }}
                        </div>
                      </div>
                    </template>
                  </el-table-column>

                  <el-table-column label="查看职位" min-width="120">
                    <template slot-scope="scope">
                      <span>{{ scope.row.jobname }}</span>
                    </template>
                  </el-table-column>

                  <el-table-column label="浏览时间" width="160">
                    <template slot-scope="scope">
                      {{ scope.row.addtime | dateFormat }}
                    </template>
                  </el-table-column>

                  <!-- <el-table-column label="操作" width="100" fixed="right">
                    <template slot-scope="scope">
                      <el-link
                        type="primary"
                        :href="scope.row.resumeLinkUrlWeb"
                        target="_blank"
                      >
                        查看简历
                      </el-link>
                    </template>
                  </el-table-column> -->
                </el-table>

                <!-- 分页 -->
                <!-- <div class="pagination-container">
                  <el-pagination
                    background
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="
                      currentRecruitType === 'downloaded'
                        ? downloadQuery.page
                        : currentRecruitType === 'viewed'
                        ? recentlyViewedQuery.page
                        : recruitmentQuery.page
                    "
                    :page-sizes="[10, 20, 30, 50]"
                    :page-size="
                      currentRecruitType === 'downloaded'
                        ? downloadQuery.pageSize
                        : currentRecruitType === 'viewed'
                        ? recentlyViewedQuery.pageSize
                        : recruitmentQuery.pageSize
                    "
                    layout="prev, pager, next"
                    :total="recruitmentTotal"
                  >
                  </el-pagination>
                </div> -->
                <!-- 收到投递分页 -->
                <div
                  v-show="currentRecruitType === 'received'"
                  class="pagination-container"
                >
                  <el-pagination
                    background
                    @size-change="handleReceivedSizeChange"
                    @current-change="handleReceivedCurrentChange"
                    :current-page="recruitmentNewsQuery.page"
                    :page-sizes="[10, 20, 30, 50]"
                    :page-size="recruitmentNewsQuery.pageSize"
                    layout="prev, pager, next"
                    :total="recruitmentTotal"
                  >
                  </el-pagination>
                </div>

                <!-- 主动下载分页 -->
                <div
                  v-show="currentRecruitType === 'downloaded'"
                  class="pagination-container"
                >
                  <el-pagination
                    background
                    @size-change="handleDownloadSizeChange"
                    @current-change="handleDownloadCurrentChange"
                    :current-page="downloadQuery.page"
                    :page-sizes="[10, 20, 30, 50]"
                    :page-size="downloadQuery.pageSize"
                    layout="prev, pager, next"
                    :total="downloadTotal"
                  >
                  </el-pagination>
                </div>

                <!-- 近期查看分页 -->
                <div
                  v-show="currentRecruitType === 'viewed'"
                  class="pagination-container"
                >
                  <el-pagination
                    background
                    @size-change="handleViewedSizeChange"
                    @current-change="handleViewedCurrentChange"
                    :current-page="recentlyViewedQuery.page"
                    :page-sizes="[10, 20, 30, 50]"
                    :page-size="recentlyViewedQuery.pagesize"
                    layout="prev, pager, next"
                    :total="recentlyViewedTotal"
                  >
                  </el-pagination>
                </div>

                <!-- 职位被查看分页 -->
                <div
                  v-show="currentRecruitType === 'positionViewed'"
                  class="pagination-container"
                >
                  <el-pagination
                    background
                    @size-change="handlePositionViewedSizeChange"
                    @current-change="handlePositionViewedCurrentChange"
                    :current-page="beingViewedQuery.page"
                    :page-sizes="[10, 20, 30, 50]"
                    :page-size="beingViewedQuery.pagesize"
                    layout="prev, pager, next"
                    :total="beingViewedTotal"
                  >
                  </el-pagination>
                </div>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="操作日志" name="10">
            <!-- 操作日志部分的模板 -->
            <div class="logs-wrapper">
              <!-- 顶部筛选器 -->
              <div class="filter-container">
                <el-button-group>
                  <el-button
                    :type="currentLogType === 'operation' ? 'primary' : ''"
                    @click="handleOperationLog"
                  >
                    操作日志
                  </el-button>
                  <el-button
                    :type="currentLogType === 'login' ? 'primary' : ''"
                    @click="handleLoginLog"
                  >
                    登录日志
                  </el-button>
                </el-button-group>
              </div>

              <!-- 操作日志表格 -->
              <div
                v-show="currentLogType === 'operation'"
                class="table-container"
              >
                <el-table
                  :data="operationLogList"
                  style="width: 100%"
                  v-loading="logsLoading"
                >
                  <el-table-column label="时间" prop="addtime" width="width">
                    <template slot-scope="scope">
                      {{ scope.row.addtime | dateFormat }}
                    </template>
                  </el-table-column>
                  <el-table-column label="操作" prop="content" width="width" />
                  <el-table-column label="IP" prop="ip" width="width" />
                  <el-table-column
                    label="IP归属地"
                    prop="ipAddr"
                    width="width"
                  />
                  <el-table-column label="来源" prop="platform" width="width">
                    <template slot-scope="scope">
                      {{
                        scope.row.platform === "mobile" ? "手机端" : "电脑端"
                      }}
                    </template>
                  </el-table-column>
                </el-table>
              </div>

              <!-- 登录日志表格 -->
              <div v-show="currentLogType === 'login'" class="table-container">
                <el-table
                  :data="loginLogList"
                  style="width: 100%"
                  v-loading="logsLoading"
                >
                  <el-table-column label="时间" prop="addtime" width="width">
                    <template slot-scope="scope">
                      {{ scope.row.addtime | dateFormat }}
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="操作内容"
                    prop="content"
                    width="width"
                  />
                  <el-table-column label="IP" prop="ip" width="width" />
                  <el-table-column
                    label="IP归属地"
                    prop="ipAddr"
                    wdith="width"
                  />
                  <el-table-column label="登录状态" width="width">
                    <template slot-scope="scope">
                      <el-tag
                        :type="scope.row.isLogin === 1 ? 'success' : 'danger'"
                      >
                        {{ scope.row.isLogin === 1 ? "成功" : "失败" }}
                      </el-tag>
                    </template>
                  </el-table-column>
                  <el-table-column label="来源" prop="platform" width="width">
                    <template slot-scope="scope">
                      {{
                        scope.row.platform === "mobile" ? "手机端" : "电脑端"
                      }}
                    </template>
                  </el-table-column>
                </el-table>
              </div>

              <!-- 操作日志分页 -->
              <div
                v-show="currentLogType === 'operation'"
                style="text-align: center"
              >
                <el-pagination
                  background
                  @size-change="handleOperationSizeChange"
                  @current-change="handleOperationCurrentChange"
                  :current-page="operationLogQuery.page"
                  :page-sizes="[10, 20, 30, 50]"
                  :page-size="operationLogQuery.pagesize"
                  layout="prev, pager, next"
                  :total="operationLogTotal"
                >
                </el-pagination>
              </div>

              <!-- 登录日志分页 -->
              <div
                v-show="currentLogType === 'login'"
                style="text-align: center"
              >
                <el-pagination
                  background
                  @size-change="handleLoginSizeChange"
                  @current-change="handleLoginCurrentChange"
                  :current-page="operationLogQuery.page"
                  :page-sizes="[10, 20, 30, 50]"
                  :page-size="operationLogQuery.pagesize"
                  layout="prev, pager, next"
                  :total="loginLogTotal"
                >
                </el-pagination>
              </div>
            </div>
          </el-tab-pane>
        </el-tabs>
      </div>
    </RightPanel>

    <!-- 批量审核风采设置弹窗 -->
    <el-dialog
      title="将所选企业风采设置为"
      :visible.sync="styleDialog"
      width="30%"
    >
      <div>
        <el-form ref="form" label-width="80px">
          <el-form-item label="审核状态" v-if="elegantAuditList.length > 0">
            <el-radio-group v-model="elegantAuditList[0].audit">
              <el-radio :label="0">待审核</el-radio>
              <el-radio :label="1">已通过</el-radio>
              <el-radio :label="2">未通过</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer">
        <el-button @click="styleDialog = false">取 消</el-button>
        <el-button type="primary" @click="onSubmit">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 单个审核风采设置弹窗 -->
    <el-dialog
      title="将所选企业风采设置为"
      :visible.sync="styleOneDialog"
      width="30%"
    >
      <div>
        <el-form ref="form" label-width="80px">
          <el-form-item label="审核状态">
            <el-radio-group v-model="styleOneAudt[0].audit">
              <el-radio :label="0">待审核</el-radio>
              <el-radio :label="1">已通过</el-radio>
              <el-radio :label="2">未通过</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer">
        <el-button @click="styleOneDialog = false">取 消</el-button>
        <el-button type="primary" @click="styleOneAudtClick">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 修改企业风采照片 -->
    <el-dialog title="修改企业风采" :visible.sync="editAuditDialog" width="30%">
      <div>
        <el-form ref="form" :model="editAuditForm" label-width="100px">
          <el-form-item label="企业名称:">
            {{ editAuditForm.companyname }}
          </el-form-item>
          <el-form-item label="上传图片:" v-model="editAuditForm.file">
            <el-upload
              action="#"
              :file-list="editFileList"
              list-type="picture-card"
              :limit="1"
              :on-change="handleChange"
              :auto-upload="false"
            >
              <i class="el-icon-plus"></i>
            </el-upload>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer">
        <el-button @click="editAuditDialog = false">取 消</el-button>
        <el-button type="primary" @click="btnOk">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 审核状态弹框 -->
    <el-dialog
      title="将所选企业设置为"
      :visible.sync="certificationDialog"
      width="30%"
      :close-on-click-modal="false"
    >
      <div>
        <el-form ref="form" label-width="100px">
          <el-form-item label="审核状态:">
            <!-- 添加 v-if 确保有选中数据时才渲染 -->
            <el-radio-group
              v-if="selectedRows.length > 0"
              v-model="selectedRows[0].audit"
            >
              <el-radio :label="0">待审核</el-radio>
              <el-radio :label="1">已审核</el-radio>
              <el-radio :label="2">未通过</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item
            v-if="selectedRows.length > 0 && selectedRows[0].audit == 2"
            label="原因:"
          >
            <el-input
              v-model="selectedRows[0].reason"
              type="textarea"
              :rows="3"
              maxlength="30"
              show-word-limit
              placeholder="请填写不通过原因"
            >
            </el-input>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="certificationDialog = false">取 消</el-button>
        <el-button type="primary" @click="handleCertification">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 显示弹框 -->
    <el-dialog title="显示状态设置" :visible.sync="displayDialog" width="30%">
      <div>
        <el-form ref="form" label-width="80px">
          <el-form-item label="显示状态">
            <el-radio-group
              v-if="displayList.length > 0"
              v-model="displayList[0].audit"
            >
              <el-radio :label="0">不显示</el-radio>
              <el-radio :label="1">显示</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer">
        <el-button @click="displayDialog = false">取 消</el-button>
        <el-button type="primary" @click="handleDisplayConfirm"
          >确 定</el-button
        >
      </div>
    </el-dialog>

    <!-- 营业执照预览弹窗 -->
    <el-dialog
      title="营业执照预览"
      :visible.sync="companyClickDialog"
      width="width"
    >
      <div style="text-align: center">
        <!-- PDF文件预览 -->
        <iframe
          v-if="isPDF"
          :src="businessUrl"
          width="100%"
          height="500px"
          frameborder="0"
        ></iframe>

        <!-- 图片预览 -->
        <el-image
          v-else
          style="width: 300px; height: 300px"
          :src="businessUrl"
          :fit="fit"
        ></el-image>
      </div>
      <div slot="footer">
        <el-button @click="companyClickDialog = false">取 消</el-button>
        <!-- 添加下载按钮 -->
        <el-button type="primary" @click="handleDownload">下载文件</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {
  GetCompanyList,
  GetCompanyAllInfo,
  GetHRCompany,
  GetCateGory,
} from "@/api/user";
import {
  corporateStyleApi,
  delEleganceByIdApi,
  updateAuditByIdApi,
  updateCompanyLogoApi,
  companyListApi,
  selOperateByUIdApi,
  updateCompanyAuditByIdApi,
  selLoginLogApi,
  selMemberByUIdApi,
  selCompanyAuditByIdApi,
  updateCompanyAuditApi,
  updateCompanyDisplayApi,
  updateCompanyRefJobApi,
  selCompanyContentListApi,
  positionListApi,
  receivedResumeListApi,
  viewRecordISawItApi,
  viewRecorLookAtMedApi,
  selCategoryDistrictListApi,
  downResumeListApi,
  selCategoryTradeListApi,
  updateAuditByIdsApi,
  exportExcelApi,
  selCategoryNatureListApi,
  selCategoryScaleListApi,
  selTagListApi,
  updateCompanyByIdApi,
  editEnterpriseBasicInfoApi,
} from "@/api/client";
import user from "@/store/modules/user";
export default {
  filters: {
    statusFilter(status) {
      const statusMap = {
        1: "success",
        4: "danger",
      };
      return statusMap[status];
    },
    auditStatus(audit) {
      const statusMap = {
        0: "待审核",
        1: "已审核",
        2: "未通过",
      };
      return statusMap[audit] || "未知状态";
    },
  },
  data() {
    return {
      ids: [],
      // 企业风采
      formStyle: [
        {
          audit: "",
          id: "",
        },
      ],
      radio: 1,
      editAuditDialog: false,
      editFileList: [],
      jobAreaList: [],
      practiceType: [
        { id: 1, name: "区级" },
        { id: 2, name: "市级" },
        { id: 3, name: "省级" },
        { id: 4, name: "国家级" },
      ],
      statusData: [
        { id: 0, name: "未认证" },
        { id: 1, name: "已认证" },
        { id: 2, name: "未通过" },
        { id: 3, name: "审核中" },
        { id: 4, name: "已退出" },
      ],
      statusType: [
        { id: -1, name: "请选择企业认证状态" },
        { id: 0, name: "未认证" },
        { id: 1, name: "已认证" },
        { id: 2, name: "未通过" },
      ],
      styleDialog: false,
      // 企业风采
      listQuery: {
        page: 1,
        pagesize: 10,
        audit: 1,
        keyType: "",
        keyword: "",
      },
      // 营业执照url图片
      businessUrl: "",
      styleArray: [],
      // 显示状态
      displayList: [],
      isFile: true,
      activeName: "1",
      activeViewName: "1",
      list: [],
      showSettings: false,
      downloadLoading: false,
      downloadLoadingZ: false,
      displayDialog: false,
      query: {
        page: 1,
        type: undefined,
        jid: -1,
        limit: 10,
        name: "",
        status: undefined,
      },
      count: 0,
      tag: [],
      formData: {
        id: undefined,
        mid: undefined,
        status: undefined,
        reason: "",
      },
      // 修改企业风采
      editAuditForm: {
        id: "",
        file: "",
      },
      // 校验表单
      rules: {
        user_name: [
          {
            required: true,
            message: this.$t("table.name") + this.$t("prompt.noEmpty"),
            trigger: "blur",
          },
        ],
        phone: [
          {
            required: true,
            message: this.$t("table.tel") + this.$t("prompt.noEmpty"),
            trigger: "blur",
          },
        ],
        status: [
          {
            required: true,
            message: this.$t("table.state") + this.$t("prompt.noEmpty"),
            trigger: "blur",
          },
        ],
      },
      rulesS: {
        money: [
          {
            required: true,
            message: "金额不能为空！" + this.$t("prompt.noEmpty"),
            trigger: "blur",
          },
        ],
      },
      formRules: {
        audit: [
          {
            required: true,
            messgae: "请选择审核状态",
            trigger: "blur",
          },
        ],
        id: [
          {
            required: true,
            messgae: "请输入id",
            trigger: "blur",
          },
        ],
      },
      showDialog: false,
      info: {},
      contact: {},
      company: {},
      attest_data: {},
      listStr: "",
      fileList: [],
      img_list: [],
      modelList: [],
      multipleSelection: [],
      selectList: {},
      showBuild: false,
      // 企业资料查询
      enterpriseListQuery: {
        page: 1,
        pagesize: 10,
        addtime: null,
        adminId: null,
        audit: 1,
        collection: null,
        district: [],
        isDisplay: null,
        jobCount: null,
        keyType: 1,
        keyword: null,
        lifeCycleId: null,
        listType: null,
        searchType: null,
        setmealDeadline: null,
        sort: null,
        sortType: null,
        trade: null,
        typeId: null,
        weixin: null,
      },
      // 企业资料查询
      enterpriseList: [],
      followForm: {
        method: "",
        contact: "",
        nextTime: "",
        result: "",
      },
      audits: 0,
      followHistory: [],
      isDisplayList: [],
      // 营业执照图片弹框
      companyClickDialog: false,
      // 认证状态
      auditList: [
        { value: 0, label: "待审核" },
        { value: 1, label: "已审核" },
        { value: 2, label: "未通过" },
        // { value: 3, label: "未认证" },
      ],
      // 显示状态
      displayDisplay: [
        { value: 1, label: "显示中" },
        { value: 0, label: "未显示" },
      ],
      // keyType下拉选择
      keyTypeList: [
        { value: 1, label: "公司名称" },
        { value: 2, label: "会员联系方式" },
        { value: 3, label: "企业联系方式" },
      ],
      followUpMethods: [
        { value: "电话", label: "电话" },
        { value: "微信", label: "微信" },
        { value: "邮件", label: "邮件" },
        { value: "面谈", label: "面谈" },
      ],
      contacts: [
        { value: "张三", label: "张三" },
        { value: "李四", label: "李四" },
        { value: "王五", label: "王五" },
      ],
      // 微信
      weChatList: [
        { value: 1, label: "企业名称" },
        { value: 2, label: "企业联系方式" },
        { value: 3, label: "会员联系方式" },
        // { value: 4, label: "企业ID" },
      ],
      jobsList: [], // 职位列表
      jobsLoading: false, // 加载状态
      jobsQuery: {
        page: 1,
        pageSize: 10,
        status: 1, // 1: 招聘中, 2: 审核中, 3: 已下线
      },
      totalJobs: 0,
      recruitmentList: [], // 招聘动态列表
      recruitmentLoading: false, // 加载状态
      recruitmentQuery: {
        page: 1,
        pageSize: 10,
        type: "received", // received: 收到投递, downloaded: 主动下载, viewed: 近期查看, positionViewed: 职位被查看
      },
      totalRecruitment: 0,
      ordersList: [], // 订单列表
      ordersLoading: false, // 加载状态
      orderQuery: {
        page: 1,
        pageSize: 10,
        serviceType: "", // 服务类型筛选
        paymentType: "", // 支付方式筛选
      },
      totalOrders: 0,
      serviceTypes: [
        { label: "职位发布", value: 1 },
        { label: "简历下载", value: 2 },
        // ... 其他服务类型
      ],
      paymentTypes: [
        { label: "微信支付", value: "wechat" },
        { label: "支付宝", value: "alipay" },
        { label: "对公转账", value: "transfer" },
      ],
      logsList: [], // 日志列表
      logsLoading: false, // 加载状态
      // 操作日志
      logsQuery: {
        page: 1,
        pageSize: 10,
        uid: "",
      },
      // 操作日志请求参数
      operationLogQuery: {
        page: 1,
        pagesize: 10,
        uid: "",
      },
      // 操作日志列表
      operationLogList: [],
      // 登录日志列表
      loginLogList: [],
      loginLogTotal: 0,
      totalLogs: 0,
      // 在招职位请求参数
      recruitingQuery: {
        audit: 1,
        page1: 1,
        pageSize: 10,
        uid: "",
      },
      // 招聘动态请求参数
      recruitmentNewsQuery: {
        page: 1,
        pageSize: 10,
        uid: "",
      },
      // 主动下载请求参数
      downloadQuery: {
        cid: "",
        page: 1,
        pageSize: 10,
      },
      // 近期查看
      recentlyViewedQuery: {
        page: 1,
        pagesize: 10,
        uid: "",
      },
      // 被查看
      beingViewedQuery: {
        page: 1,
        pagesize: 10,
        uid: "",
      },
      jumpPage: "", // 跳转页码
      showSelection: true,
      checkAll: false,
      isIndeterminate: false,
      certificationDialog: false, // 认证弹框显示状态
      certificationStatus: 0, // 认证状态
      selectedRows: [], // 选中的行数据
      uid: "",
      displayStatus: 0, // 添加显示状态变量
      customerDetails: {}, // 客户详情
      contactsList: {}, // 联系人列表
      vacancyList: [], // 招聘中职位
      recruitmentNewsList: [],
      recentlyViewedList: [],
      beingViewedList: [],
      operationLogTotal: 0,
      recentlyViewedTotal: 0,
      currentLogType: "operation", // 当前日志类型
      currentJobType: "recruiting", // 默认显示招聘中职位
      currentRecruitType: "received", // 当前选中的招聘动态类型：received(收到投递)、downloaded(主动下载)、viewed(近期查看)、positionViewed(职位被查看)
      recruitmentNewsList: [], // 招聘动态列表数据
      recruitmentLoading: false, // 加载状态
      recruitmentTotal: 0, // 总数
      recruitmentQuery: {
        page: 1,
        pageSize: 10,
      },
      downloadList: [], // 下载的简历列表
      downloadLoading: false, // 加载状态
      selCategoryTradeLists: [],
      enterpriseTotal: 0,
      companyTypeList: [
        { value: 1, label: "公司名称" },
        { value: 2, label: "公司ID" },
        { value: 3, label: "会员ID" },
      ],
      // 审核状态
      audiFctList: [
        { value: "", label: "不限审核状态" },
        { value: 0, label: "待审核" },
        { value: 1, label: "已通过" },
        { value: 2, label: "未通过" },
      ],
      // 批量审核
      elegantAuditList: [],
      styleOneDialog: false,
      styleOneAudt: [
        {
          audit: 0,
          id: "",
        },
      ],
      baseUrl: "https://blwadmin.nbblmc.cn",
      companyContent: {},
      // 企业资料表单
      enterpriseListForm: {},
      companyRules: {
        cid: [{ required: true, message: "企业ID不能为空", trigger: "blur" }],
        contact: [{ required: true, message: "请输入联系人", trigger: "blur" }],
        content: [
          { required: true, message: "请输入企业介绍", trigger: "blur" },
        ],
        district: [
          { required: true, message: "请选择企业地区", trigger: "change" },
        ],
        district1: [
          { required: true, message: "请选择省份", trigger: "change" },
        ],
        district2: [
          { required: true, message: "请选择城市", trigger: "change" },
        ],
        district3: [
          { required: true, message: "请选择区域", trigger: "change" },
        ],
        mobile: [{ required: true, message: "请输入手机号", trigger: "blur" }],
        nature: [
          { required: true, message: "请选择企业性质", trigger: "change" },
        ],
        scale: [
          { required: true, message: "请选择企业规模", trigger: "change" },
        ],
        trade: [
          { required: true, message: "请选择所属行业", trigger: "change" },
        ],
        uid: [{ required: true, message: "用户ID不能为空", trigger: "blur" }],
      },
      tags: [],
      // 学历要求
      jobExperience: [
        { value: 0, label: "不限学历" },
        { value: 1, label: "初中" },
        { value: 2, label: "高中" },
        { value: 3, label: "中技" },
        { value: 4, label: "中专" },
        { value: 5, label: "大专" },
        { value: 6, label: "本科" },
        { value: 7, label: "硕士" },
        { value: 8, label: "博士" },
        { value: 9, label: "博士后" },
      ],
      // 工作经验
      experienceList: [
        { value: 0, label: "不限工作经验" },
        { value: 1, label: "应届生" },
        { value: 2, label: "1年" },
        { value: 3, label: "2年" },
        { value: 4, label: "3年" },
        { value: 5, label: "3-5年" },
        { value: 6, label: "5-10年" },
      ],
      // 企业性质
      enterpriseXzList: [],
      // 企业规模
      enterpriseGmList: [],
      // 所属行业
      enterpriseHyList: [],
      isPDF: false,
    };
  },
  async created() {
    // 获取userid
    // this.formData.mid = parseFloat(user.state.userId);
    // this.getUserAdmin();
    this.corporateStyle();
    this.selCategoryDistrictList();
    this.selCategoryTradeList();
    this.selCategoryNatureList();
    this.selCategoryScaleList();
    await this.selTagList();
    this.companyList();
    if (this.$route.query) {
      console.log(this.$route.query);
      this.enterpriseListQuery.audit = this.$route.query.audit;
    }
    // this.exportAllClick();
  },
  methods: {
    // 保存企业资料
    async saveEnterpriseList() {
      try {
        await this.$refs.companyForm.validate();

        // 构建接口所需的参数对象
        const params = {
          address: this.enterpriseListForm.address,
          cid: this.enterpriseListForm.id,
          contact: this.enterpriseListForm.contact,
          content: this.enterpriseListForm.content,
          district1: this.enterpriseListForm.district1,
          district2: this.enterpriseListForm.district2,
          district3: this.enterpriseListForm.district3,
          isSecrecy: this.enterpriseListForm.isSecrecy,
          mobile: this.enterpriseListForm.contactMobile,
          nature: this.enterpriseListForm.nature,
          registered: this.enterpriseListForm.registered,
          scale: this.enterpriseListForm.scale,
          tags: this.enterpriseListForm.tagTextArr,
          trade: this.enterpriseListForm.trade,
          uid: this.enterpriseListForm.uid,
        };

        const res = await updateCompanyByIdApi(params);

        if (res.code === 1) {
          this.$message.success("保存成功");
        } else {
          this.$message.error(res.msg || "保存失败");
        }
      } catch (error) {
        console.error("提交表单失败:", error);
        this.$message.error("表单验证失败，请检查必填项");
      }
    },
    // tag列表
    async selTagList() {
      const res = await selTagListApi();
      console.log("标签列表数据:", res.data);
      this.tags = res.data;
    },
    // 企业性质查询
    async selCategoryNatureList() {
      const res = await selCategoryNatureListApi();
      this.enterpriseXzList = res.data;
    },
    // 企业规模查询
    async selCategoryScaleList() {
      const res = await selCategoryScaleListApi();
      this.enterpriseGmList = res.data;
    },
    // 管理类别查询
    async selCategoryTradeList() {
      const res = await selCategoryTradeListApi();
      console.log(res);
      this.selCategoryTradeLists = res.data;
    },

    // 点击查看
    companyClick(url) {
      if (!url) {
        this.$message.warning("暂无营业执照文件");
        return;
      }

      this.businessUrl = url;
      // 判断是否为PDF文件
      this.isPDF = url.toLowerCase().endsWith(".pdf");
      console.log(this.isPDF);

      this.companyClickDialog = true;
    },
    // 全部导出
    async exportAllClick() {
      let loading = null;
      try {
        await this.$confirm("此操作将导出所有企业和职位, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        });

        // 显示loading
        loading = this.$loading({
          lock: true,
          text: "正在导出数据,请稍候...",
          spinner: "el-icon-loading",
          background: "rgba(0, 0, 0, 0.7)",
        });

        const res = await exportExcelApi();

        if (res.code === 1 && res.data) {
          // 创建a标签下载
          const link = document.createElement("a");
          link.href = res.data;
          link.download = "企业和岗位信息导出.xlsx";
          document.body.appendChild(link);
          link.click();
          document.body.removeChild(link);
          this.$message.success("导出成功");
        } else {
          this.$message.error(res.msg);
        }
      } catch (error) {
        // console.error("导出错误:", error);
        // this.$message.error("导出失败");
      } finally {
        // 关闭loading
        if (loading) {
          loading.close();
        }
      }
    },
    handleAuditCheckboxChange(item) {
      console.log(item); // 修改这里，使用 console.log 而不是 log
      // 检查是否已经存在于数组中
      const index = this.elegantAuditList.findIndex((i) => i.id === item.id);
      if (index === -1) {
        // 如果不存在，则添加
        this.elegantAuditList.push(item);
      } else {
        // 如果已存在，则移除
        this.elegantAuditList.splice(index, 1);
      }
      console.log(this.elegantAuditList);
    },
    // 点击分页
    handleSizeElegantChange(pageSize) {
      this.listQuery.pagesize = pageSize;
      this.corporateStyle();
    },
    // 点击分页
    handleCurrentElegantChange(page) {
      this.listQuery.page = page;
      this.corporateStyle();
    },
    // 处理刷新时间排序
    handleRefreshTimeSort({ order }) {
      console.log(order);
      this.enterpriseListQuery.sortType = "refreshtime";
      this.enterpriseListQuery.sort = order === "ascending" ? "asc" : "desc";
      this.companyList(); // 重新获取数据列表
    },

    // 管理工作地区查询
    async selCategoryDistrictList() {
      const res = await selCategoryDistrictListApi();
      console.log(res);
      this.jobAreaList = res.data[0].map((item) => ({
        label: item.name, // 父级项的 value 设置为 name
        value: item.id,
        children: item.children
          ? item.children.map((child) => ({
              label: child.name, // 子项的 label 设置为 name
              value: child.id, // 子项的 value 设置为 id 的字符串形式
              children: child.children.map((subDistrict) => ({
                label: subDistrict.name, // 父级项的 value 设置为 name
                value: subDistrict.id,
              })), // 子项的 children 默认为空数组，如果需要更深层次的数据结构，可以在这里添加逻辑
            }))
          : [], // 如果没有 categoryDistricts，children 设置为空数组
      }));

      // console.log(this.jobAreaList);
    },
    // 会员信息改变
    handleKeyTypeChange(val) {
      console.log(val);
      this.enterpriseListQuery.page = 1;
      this.companyList();
    },
    // 地区改变的时候
    handleAreaChange(val) {
      console.log(val);
      this.enterpriseListQuery.page = 1;
      this.companyList();
    },
    // 所属行业的改变
    handleTradeChange(val) {
      console.log(val);
      this.enterpriseListQuery.page = 1;
      this.companyList();
    },
    // 显示状态改变
    handleDisplayChange(val) {
      console.log(val);
      this.enterpriseListQuery.page = 1;
      this.companyList();
    },
    // 选择认证状态
    handleAuditChange(val) {
      console.log(val);
      this.enterpriseListQuery.page = 1;
      this.companyList();
    },
    handlesearch(val) {
      console.log(val);
      this.companyList();
    },
    // 操作日志
    operationLogClick() {},
    // 登录日志
    async loginLogClick() {
      const res = await selLoginLogApi(this.operationLogQuery);
      console.log(res);
      this.loginLogList = res.records;
      this.loginLogTotal = res.total;
    },
    // 刷新职位
    handleRefJobClick() {
      if (this.ids.length === 0) {
        this.$message.warning("请选择刷新的企业");
        return;
      }
      this.$confirm("确定要刷新所选企业的职位?", "系统提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(async () => {
          console.log(this.ids);
          try {
            const res = await updateCompanyRefJobApi(this.ids);
            console.log(res);
            if (res.code === 1) {
              this.$message.success("刷新成功");
              this.companyList();
              this.$refs.multipleTable.clearSelection();
            } else {
              this.$message.error("刷新失败");
            }
          } catch {
            this.$message.error("刷新失败");
          }
        })
        .catch(() => {});
    },
    // 点击查看的tabs
    async handleClick(tab, event) {
      console.log(tab);
      if (tab.name === "4") {
        console.log(this.uid);
        const res = await selMemberByUIdApi(this.uid);
        this.customerDetails = res.data;
        if (res.code === 1) {
        } else {
          this.$message.error(res.msg);
        }
      } else if (tab.name === "6") {
        const res = await selCompanyContentListApi(this.uid);
        console.log(res);
        this.contactsList = res.data;
      } else if (tab.name === "7") {
        const res = await positionListApi(this.recruitingQuery);
        console.log(res);
        this.vacancyList = res.records;
        console.log(this.vacancyList);
      } else if (tab.name === "8") {
        const res = await receivedResumeListApi(this.recruitmentNewsQuery);
        console.log(res);
        this.recruitmentNewsList = res.records;
        this.recruitmentTotal = res.total;
      } else if (tab.name === "10") {
        const res = await selOperateByUIdApi(this.operationLogQuery);
        console.log(res);
        this.operationLogList = res.records;
        this.operationLogTotal = res.total;
      }
    },
    // 企业资料查询
    async companyList() {
      const res = await companyListApi(this.enterpriseListQuery);
      console.log(res);
      this.enterpriseList = res.records;
      this.enterpriseTotal = res.total;
    },
    // 选择图片的时候
    async handleChange(file, fileList) {
      console.log(file);
      this.editAuditForm.file = file.raw;
      this.editFileList = file.raw;
      this.fileList = fileList.map((item) => item);
      console.log(this.editFileList);
    },
    // 修改企业风采
    async btnOk() {
      try {
        const formData = new FormData();
        // formData.append("id", this.editAuditForm.id);
        formData.append("file", this.editAuditForm.file);
        const res = await updateCompanyLogoApi(formData, this.editAuditForm.id);
        console.log(res);
        if (res.code === 1) {
          this.$message.success("修改企业图标成功");
          this.corporateStyle();
          this.editAuditDialog = false;
        } else {
          this.$message.error("修改企业图标失败");
        }
      } catch {
        this.$message.error("修改企业图标失败");
      }
    },
    // 修改审核
    editAudit(row) {
      console.log(row);
      this.editAuditDialog = true;
      const res = Object.assign(this.editAuditForm, {
        id: row.id,
        imgSrc: row.imgSrc,
        companyname: row.companyname,
      });
      // console.log(res);
      console.log(this.editAuditForm);
      this.editFileList = [{ url: this.editAuditForm.imgSrc }];
      console.log(this.editFileList);
    },
    // 改变审核状态
    handleInput(value) {
      console.log(value);
      this.formStyle.audit = value;
    },
    // 企业风采批量审核确认点击
    async onSubmit() {
      try {
        const { audit } = this.elegantAuditList[0];
        this.elegantAuditList = this.elegantAuditList.map((row) => ({
          id: row.id,
          audit,
        }));

        const res = await updateAuditByIdsApi(this.elegantAuditList);
        if (res.code === 1) {
          this.$message.success("设置成功");
          this.styleDialog = false;

          // 重置所有选中状态
          this.styleArray = this.styleArray.map((item) => ({
            ...item,
            isChecked: false,
          }));

          this.corporateStyle();
          this.elegantAuditList = [];
        } else {
          this.$message.error("设置失败");
        }
      } catch {
        this.$message.error("设置失败");
      }
    },
    // 审核
    examine(item) {
      console.log(item);
      this.styleOneAudt[0].id = item.id;
      this.styleOneAudt[0].audit = item.audit;
      console.log(this.styleOneAudt);
      this.styleOneDialog = true;
    },
    // 企业风采查询
    async corporateStyle() {
      const res = await corporateStyleApi(this.listQuery);
      this.styleArray = res.records.map((item) => ({
        ...item,
        isChecked: false, // 添加 isChecked 字段
      }));
      this.elegantTotal = res.total;
    },
    // 企业类型改变
    handleCompanyTypeChange(val) {
      console.log(val);
      this.listQuery.page = 1;
      this.corporateStyle();
    },
    // 企业资料改变
    handleQyInfoChange(value) {
      if (value && value.length > 0) {
        this.enterpriseListForm.district1 = value[0] || "";
        this.enterpriseListForm.district2 = value[1] || "";
        this.enterpriseListForm.district3 = value[2] || 0;
      }
    },
    // 删除
    async btnDelStyle(item) {
      // 显示确认对话框
      const confirmResult = await this.$confirm(
        `确定删除 ${item.companyname} 企业风采吗`,
        "提示",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      );
      console.log(confirmResult);
      // 根据用户的选择执行不同的操作
      if (confirmResult === "cancel") {
        // 用户点击了取消
        this.$message({
          type: "info",
          message: "已取消删除",
        });
      } else {
        // 用户点击了确定，调用接口
        try {
          const res = await delEleganceByIdApi(item.id);
          console.log(res);
          if (res.code === 1) {
            this.corporateStyle();
          }
          this.$message({
            type: "success",
            message: "删除成功!",
          });
        } catch (error) {
          // 接口调用失败的处理
          this.$message({
            type: "error",
            message: "删除失败",
          });
        }
      }
    },
    selseChan(e) {
      this.attest_data.reason = e;
    },
    // 获取同步企业数据
    async getHRCompany() {
      try {
        await this.$confirm("确定同步数据吗？");
        this.downloadLoadingZ = true;
        await GetHRCompany();
        this.getCateGory();
      } catch (error) {
        this.downloadLoadingZ = false;
      }
    },
    async getCateGory() {
      try {
        await GetCateGory();
        this.downloadLoadingZ = false;
        this.$message.success("同步成功！");
      } catch (error) {
        this.downloadLoadingZ = false;
        this.$message.error("失败！");
      }
    },
    // 获取管理员列表
    async getUserAdmin() {
      this.downloadLoading = true;
      const { count, list } = await GetCompanyList(this.query);
      this.list = list;
      this.count = count;
      this.downloadLoading = false;
    },
    // 搜索
    search() {
      this.query.page = 1;
      this.getUserAdmin();
    },
    // 点击分页
    handleSizeQyChange(val) {
      this.enterpriseListQuery.pagesize = val;
      this.companyList();
    },
    // 点击分页
    handleCurrentQyChange(val) {
      this.enterpriseListQuery.page = val;
      this.companyList();
    },
    // 点击展开新增修改
    addAdminOpen(row) {
      console.log(row);
      this.activeName = "1";
      this.getAttestationInfo(row);
      this.companyContent = row;
      console.log(this.companyContent.tagTextArr);
      // 企业资料
      this.enterpriseListForm = row;
      // 如果有tags数据，进行名称匹配
      if (row.tagTextArr && row.tagTextArr.length > 0) {
        // 将字符串数组转换为id数组
        const matchedTags = this.tags
          .filter((tag) => {
            const isMatch = row.tagTextArr.includes(tag.name);
            console.log(`检查标签 ${tag.name}: ${isMatch}`);
            return isMatch;
          })
          .map((tag) => tag.id);
        // 将字符串数组转换为id数组
        const matchedNameTags = this.tags
          .filter((tag) => row.tagTextArr.includes(tag.name))
          .map((tag) => tag.name);

        console.log(matchedNameTags);

        // 先设置企业表单的tags为ID数组
        this.enterpriseListForm.tagTextArr = matchedTags;

        // 确保companyContent的tagTextArr为标签名称数组，使用$set确保响应式更新
        this.$set(this.companyContent, "tagTextArr", matchedNameTags);
        // 或者使用下面的方式也可以：
        // this.companyContent = { ...this.companyContent, tagTextArr: matchedNameTags };

        console.log("设置后的标签文本:", this.companyContent.tagTextArr);
      }

      this.uid = row.uid;
      this.operationLogQuery.uid = row.uid;
      this.recruitingQuery.uid = row.uid;
      this.recruitmentNewsQuery.uid = row.uid;
      this.downloadQuery.cid = row.id;
      this.recentlyViewedQuery.uid = row.uid;
      this.beingViewedQuery.uid = row.uid;
      console.log(this.uid);
      this.$refs.panel.show = !this.$refs.panel.show;
    },
    // 获取审核详情
    async getAttestationInfo(row) {
      this.activeName = "1";
      this.company = {};
      this.tag = [];
      this.info = {};
      this.contact = {};
      this.listStr = "";
      this.img_list = [];
      this.formData.id = row.id;
      this.formData.status = row.status;
      this.formData.reason = row.reason;
      const one = {
        bid: row.id,
      };
      const { data, tag_list, info, contact, attest_data, img_list } =
        await GetCompanyAllInfo(one);
      this.company = data;
      this.tag = tag_list;
      this.info = info;
      this.contact = contact;
      this.attest_data = attest_data;
      if (tag_list.length > 0) {
        this.listStr = tag_list.join(",");
      }
      this.img_list = img_list;
      this.openDialog();
      this.getAttestModel();
    },
    btnCanleBuild() {
      this.selectList = [];
      this.showBuild = false;
    },
    // 给图片赋值
    openDialog() {
      if (this.img_list.length > 0) {
        const NewArr = [];
        this.img_list.forEach((item) => {
          const one = {
            url: item.url,
            upload: true,
          };
          NewArr.push(one);
        });
        this.$refs.img_list.fileList = NewArr;
      } else {
        this.$refs.img_list.fileList = [];
      }
    },
    // 分页
    changPage(newPage) {
      this.query.page = newPage;
      this.getUserAdmin();
    },
    async handleFollowFileChange(event) {
      const file = event.file;
      const fileList = event.fileList;
      console.log(file);
      console.log(fileList);
      this.followForm.result = file.name;
      this.followHistory.push({
        createTime: new Date().toISOString(),
        method: this.followForm.method,
        contact: this.followForm.contact,
        result: this.followForm.result,
        images: fileList.map((item) => item.url),
      });
    },
    async submitFollow() {
      try {
        await this.$confirm("确定保存跟进记录吗？");
        const res = await updateFollowRecordApi(this.followForm);
        console.log(res);
        this.$message.success("跟进记录保存成功");
        this.followForm = {
          method: "",
          contact: "",
          nextTime: "",
          result: "",
        };
        this.followHistory = [];
      } catch (error) {
        console.error("保存跟进记录失败", error);
        this.$message.error("保存跟进记录失败");
      }
    },
    // 批量审核
    handleBatchAudit() {
      if (this.elegantAuditList.length === 0) {
        this.$message.warning("请先选择要审核的企业");
        return;
      }
      this.styleDialog = true;
    },
    async resetFollow() {
      this.followForm = {
        method: "",
        contact: "",
        nextTime: "",
        result: "",
      };
      this.followHistory = [];
    },
    handleAddContact() {
      this.corporateStyle();
    },
    // 获取职位列表
    async getJobsList() {
      this.jobsLoading = true;
      try {
        // 调用接口获取数据
        const { data, total } = await getJobsListApi(this.jobsQuery);
        this.jobsList = data;
        this.totalJobs = total;
      } catch (error) {
        console.error("获取职位列表失败:", error);
      } finally {
        this.jobsLoading = false;
      }
    },
    // 编辑职位
    handleEdit(row) {
      // 实现编辑逻辑
    },
    // 刷新职位
    handleRefresh(row) {
      // 实现刷新逻辑
    },
    // 切换职位状态
    handleToggleStatus(row) {
      // 实现上下线切换逻辑
    },
    // 分页相关方法
    handleSizeChange(val) {
      this.jobsQuery.pageSize = val;
      this.getJobsList();
    },
    handleCurrentChange(val) {
      this.jobsQuery.page = val;
      this.getJobsList();
    },
    // 获取招聘动态列表
    async getRecruitmentList() {
      this.recruitmentLoading = true;
      try {
        // 调用接口获取数据
        const { data, total } = await getRecruitmentListApi(
          this.recruitmentQuery
        );
        this.recruitmentList = data;
        this.totalRecruitment = total;
      } catch (error) {
        console.error("获取招聘动态列表失败:", error);
      } finally {
        this.recruitmentLoading = false;
      }
    },
    // 查看简历
    handleViewResume(row) {
      // 实现查看简历逻辑
    },
    // 发送面试邀请
    handleInvite(row) {
      // 实现面试邀请逻辑
    },
    // 下载简历
    handleDownload() {
      if (!this.businessUrl) {
        this.$message.warning("无文件可下载");
        return;
      }

      // 创建一个临时的a标签来下载文件
      const link = document.createElement("a");
      link.href = this.businessUrl;
      link.target = "_blank";
      // 设置下载文件名
      const fileName = this.isPDF ? "营业执照.pdf" : "营业执照.jpg";
      link.download = fileName;
      document.body.appendChild(link);
      link.click();
      document.body.removeChild(link);
    },
    // 分页相关方法
    handleRecruitmentSizeChange(val) {
      this.recruitmentQuery.pageSize = val;
      this.getRecruitmentList();
    },
    handleRecruitmentCurrentChange(val) {
      this.recruitmentQuery.page = val;
      this.getRecruitmentList();
    },
    // 获取订单列表
    async getOrdersList() {
      this.ordersLoading = true;
      try {
        // 调用接口获取数据
        const { data, total } = await getOrdersListApi(this.orderQuery);
        this.ordersList = data;
        this.totalOrders = total;
      } catch (error) {
        console.error("获取订单列表失败:", error);
      } finally {
        this.ordersLoading = false;
      }
    },
    // 获取支付方式标签类型
    getPaymentTagType(type) {
      const types = {
        wechat: "success",
        alipay: "primary",
        transfer: "warning",
      };
      return types[type] || "info";
    },
    // 查看订单详情
    handleViewOrder(row) {
      // 实现查看订单详情逻辑
    },
    // 支付订单
    handlePayOrder(row) {
      // 实现支付订单逻辑
    },
    // 分页相关方法
    handleOrdersSizeChange(val) {
      this.orderQuery.pageSize = val;
      this.getOrdersList();
    },
    handleOrdersCurrentChange(val) {
      this.orderQuery.page = val;
      this.getOrdersList();
    },
    handleSearchClear() {
      this.logsQuery.keyword = "";
      this.handleSearch();
    },
    handleSearch() {
      this.logsQuery.page = 1;
      this.getLogsList();
    },
    handleLogsSizeChange(val) {
      this.logsQuery.pageSize = val;
      this.getLogsList();
    },
    handleLogsCurrentChange(val) {
      this.logsQuery.page = val;
      this.getLogsList();
    },
    getActionTagType(action) {
      const types = {
        操作成功: "success",
        操作失败: "danger",
        登录成功: "info",
        登录失败: "warning",
      };
      return types[action] || "info";
    },
    async getLogsList() {
      this.logsLoading = true;
      try {
        const { data, total } = await getLogsListApi(this.logsQuery);
        this.logsList = data;
        this.totalLogs = total;
      } catch (error) {
        console.error("获取日志列表失败:", error);
      } finally {
        this.logsLoading = false;
      }
    },
    // 全选/取消全选
    handleCheckAllChange(val) {
      this.$refs.table.toggleAllSelection();
      this.isIndeterminate = false;
    },
    // 表格选择项变化
    handleSelectionChange(selection) {
      try {
        this.ids = selection.map((item) => item.id);
        this.displayList = selection.map((item) => ({
          id: item.id,
          audit: 0,
        }));
        console.log(this.displayList);
        this.selectedRows = selection.map((item) => ({
          cid: item.id,
          uid: item.uid,
          audit: item.audit || 0, // 使用相同的默认值
          reason: item.reason || "", // 使用相同的默认值
        }));
        console.log(this.selectedRows);
      } catch (error) {
        console.error("选择状态更新失败:", error);
      }
    },
    // 点击认证按钮
    handleAuthClick() {
      if (this.selectedRows.length === 0) {
        this.$message.warning("请先选择要审核的企业");
        return;
      }
      // console.log(this.selectedRows);
      this.certificationDialog = true;
    },
    // 处理认证确认
    async handleCertification() {
      if (this.selectedRows.length === 0) {
        this.$message.warning("请先选择要认证的企业");
        return;
      }

      try {
        // 如果是未通过状态但没有填写原因
        if (this.selectedRows[0].audit === 2 && !this.selectedRows[0].reason) {
          this.$message.error("请填写未通过原因");
          return;
        }
        // 获取第一项的 audit 和 reason
        const { audit, reason } = this.selectedRows[0];
        // 同步所有选中项的 audit 和 reason
        this.selectedRows = this.selectedRows.map((row) => ({
          ...row,
          audit, // 使用第一项的 audit
          reason, // 使用第一项的 reason
        }));
        console.log(this.selectedRows);
        // 这里添加你的认证状态更新接口调用
        const res = await updateCompanyAuditApi(this.selectedRows);
        console.log(res);
        if (res.code === 1) {
          this.$message.success("设置成功");
          this.certificationDialog = false;
          this.companyList();

          this.$refs.multipleTable.clearSelection();
        } else {
          this.$message.error("设置失败");
        }
        // this.certificationDialog = false;
      } catch (error) {
        console.error("设置失败:", error);
        this.$message.error("设置失败");
      }
    },
    // 点击显示按钮
    handleDisplayClick() {
      if (this.selectedRows.length === 0) {
        this.$message.error("请先选择要设置的企业");
        return;
      }
      this.displayDialog = true;
    },
    // 单个企业风采审核
    async styleOneAudtClick() {
      try {
        const res = await updateAuditByIdsApi(this.styleOneAudt);
        if (res.code === 1) {
          this.$message.success("设置成功");
          this.styleOneDialog = false;

          // 更新本地数据中对应项的状态
          const updatedItem = this.styleArray.find(
            (item) => item.id === this.styleOneAudt[0].id
          );
          if (updatedItem) {
            updatedItem.audit = this.styleOneAudt[0].audit;
          }

          // 刷新列表数据
          await this.corporateStyle();

          // 重置审核表单
          this.styleOneAudt = [
            {
              audit: 0,
              id: "",
            },
          ];
        } else {
          this.$message.error(res.msg || "设置失败");
        }
      } catch (error) {
        console.error("审核失败:", error);
        this.$message.error("设置失败");
      }
    },
    // 处理显示状态确认
    handleDisplay() {
      // 检查显示列表是否为空
      if (this.displayList.length === 0) {
        this.$message.warning("请先选择要设置的企业");
        return;
      }
      console.log(this.displayList);
      this.displayDialog = true;
    },
    // 处理显示状态确认
    async handleDisplayConfirm() {
      try {
        // 获取到第一项的 audit
        const { audit } = this.displayList[0];
        // 同步所有选中项的 audit
        this.displayList = this.displayList.map((item) => ({
          audit,
          id: item.id,
        }));
        const res = await updateCompanyDisplayApi(this.displayList);
        console.log(res);
        if (res.code === 1) {
          this.$message.success("设置成功!");
          this.displayDialog = false;
          this.companyList();
          this.$refs.multipleTable.clearSelection();
        } else {
          this.$message.error("设置失败");
        }
      } catch {}
    },
    // 审核状态改变
    handleAuditFcChange(val) {
      console.log(val);
      this.listQuery.page = 1;
      this.corporateStyle();
    },
    // 切换日志类型
    switchLogType(type) {
      this.currentLogType = type;
      this.handleSearch();
    },
    // 获取登录日志的方法
    async getLoginLogs() {
      this.logsLoading = true;
      try {
        const res = await selLoginLogApi(this.operationLogQuery);
        console.log(res);
        if (res.code === 1) {
          this.loginLogList = res.records;
          this.loginLogTotal = res.total || 0;
        } else {
          this.$message.error(res.msg || "获取登录日志失败");
        }
      } catch (error) {
        console.error("获取登录日志失败:", error);
        this.$message.error("获取登录日志失败");
      } finally {
        this.logsLoading = false;
      }
    },

    // 获取操作日志的方法
    async getOperationLogs() {
      this.logsLoading = true;
      try {
        const res = await selOperateByUIdApi(this.operationLogQuery);
        this.operationLogList = res.records;
        this.operationLogTotal = res.total;
      } catch (error) {
        console.error("获取操作日志失败:", error);
        this.$message.error("获取操作日志失败");
      } finally {
        this.logsLoading = false;
      }
    },

    // 分页方法
    handleCurrentChange(page) {
      this.operationLogQuery.page = page;
      if (this.currentLogType === "login") {
        this.getLoginLogs();
      } else {
        this.getOperationLogs();
      }
    },

    // 点击操作日志按钮
    async handleOperationLog() {
      this.currentLogType = "operation"; // 更新类型以切换颜色
      const res = await selOperateByUIdApi(this.operationLogQuery);
      console.log(res);
      this.operationLogList = res.records;
      this.operationLogTotal = res.total;
    },

    // 点击登录日志按钮
    async handleLoginLog() {
      this.currentLogType = "login"; // 更新类型以切换颜色
      try {
        const res = await selLoginLogApi(this.operationLogQuery);
        console.log(res);
        this.loginLogList = res.records;
        this.loginLogTotal = res.total;
        // 根据返回的数据结构处理数据
      } catch (error) {
        console.error("获取登录日志失败:", error);
        this.$message.error("获取登录日志失败");
      }
    },
    // 处理职位类型切换
    async handleJobTypeChange(type) {
      console.log(type);
      this.currentJobType = type; // 更新当前类型，触发按钮颜色变化
      this.jobsLoading = true;

      try {
        // 根据不同类型设置不同的 audit 值
        switch (type) {
          case "recruiting":
            this.recruitingQuery.audit = 1; // 招聘中
            break;
          case "reviewing":
            this.recruitingQuery.audit = 2; // 审核中
            break;
          case "offline":
            this.recruitingQuery.audit = 3; // 已下线
            break;
        }

        // 调用统一的接口获取数据
        const res = await positionListApi(this.recruitingQuery);
        this.vacancyList = res.records; // 更新列表数据
      } catch (error) {
        console.error("获取职位列表失败:", error);
        this.$message.error("获取职位列表失败");
      } finally {
        this.jobsLoading = false;
      }
    },
    // 全选/反选方法
    toggleSelection() {
      // 判断当前是否有选中的行
      if (this.multipleSelection && this.multipleSelection.length > 0) {
        // 如果有选中的行，则清空选择
        this.$refs.multipleTable.clearSelection();
      } else {
        // 如果没有选中的行，则全选
        this.$refs.multipleTable.toggleAllSelection();
      }
    },
    // 处理招聘动态类型切换
    async handleRecruitTypeChange(type) {
      this.currentRecruitType = type;

      try {
        if (type === "viewed") {
          // 近期查看
          this.viewedLoading = true;
          const res = await viewRecordISawItApi(this.recentlyViewedQuery);
          this.recentlyViewedList = res.records;
          this.recentlyViewedTotal = res.total;
        } else if (type === "downloaded") {
          this.downloadLoading = true;
          try {
            const res = await downResumeListApi({
              cid: this.downloadQuery.cid,
              page: this.downloadQuery.page,
              pageSize: this.downloadQuery.pageSize,
            });
            this.downloadList = res.records;
            this.downloadTotal = res.total;
          } catch (error) {
            console.error("获取主动下载列表失败:", error);
            this.$message.error("获取主动下载列表失败");
          } finally {
            this.downloadLoading = false;
          }
        } else if (type === "received") {
          // ... 保持原有的收到投递逻辑
          this.downloadLoading = true;
          const res = await receivedResumeListApi(this.recruitmentNewsQuery);
          this.recruitmentNewsList = res.records;
          this.recruitmentTotal = res.total;
        } else if (type === "positionViewed") {
          this.downloadLoading = true;
          const res = await viewRecorLookAtMedApi(this.beingViewedQuery);
          console.log(res);
          this.beingViewedList = res.records;
          this.beingViewedTotal = res.total;
        }
      } catch (error) {
        console.error("获取数据失败:", error);
        this.$message.error("获取数据失败");
      } finally {
        this.downloadLoading = false;
        this.viewedLoading = false;
      }
    },
    // 查看简历详情
    handleResumeDetail(row) {
      // 打开简历详情页面
      window.open(row.resumeLinkUrlWeb, "_blank");
    },

    // 查看职位详情
    handleJobDetail(row) {
      // 打开职位详情页面
      window.open(row.jobLinkUrlWeb, "_blank");
    },

    // 分页大小改变
    handleSizeChange(val) {
      this.downloadQuery.pageSize = val;
      this.handleRecruitTypeChange(this.currentRecruitType);
    },

    // 当前页改变
    handleCurrentChange(val) {
      this.downloadQuery.page = val;
      this.handleRecruitTypeChange(this.currentRecruitType);
    },
    getStatusType(audit) {
      // 定义不同状态对应的 tag 类型
      const typeMap = {
        0: "warning", // 待审核 - 黄色
        1: "success", // 已认证 - 绿色
        2: "danger", // 未通过 - 红色
        3: "info", // 未认证 - 灰色
      };
      return typeMap[audit] || "info";
    },
    // 统一处理排序变化
    handleSortChange({ prop, order }) {
      console.log("排序变化:", prop, order); // 添加日志便于调试

      // 根据不同列设置不同的sortType
      if (prop === "addtime") {
        this.enterpriseListQuery.sortType = "addtime";
      } else if (prop === "lastLoginTime") {
        this.enterpriseListQuery.sortType = "lastLoginTime";
      } else if (prop === "refreshtime") {
        this.enterpriseListQuery.sortType = "refreshtime";
      }

      // 设置排序方向
      this.enterpriseListQuery.sort = order === "ascending" ? "asc" : "desc";

      // 重新获取列表数据
      this.companyList();
    },
    clearTags() {
      this.companyContent.tagTextArr = [];
    },
    // 操作日志分页方法
    handleOperationSizeChange(val) {
      this.operationLogQuery.pagesize = val;
      this.handleOperationLog();
    },
    handleOperationCurrentChange(val) {
      this.operationLogQuery.page = val;
      this.handleOperationLog();
    },
    // 登录日志分页方法
    handleLoginSizeChange(val) {
      this.operationLogQuery.pagesize = val;
      this.handleLoginLog();
    },
    handleLoginCurrentChange(val) {
      this.operationLogQuery.page = val;
      this.handleLoginLog();
    },
    // 收到投递分页方法
    async handleReceivedSizeChange(val) {
      this.recruitmentNewsQuery.pageSize = val;
      // 收到投递
      const res = await receivedResumeListApi(this.recruitmentNewsQuery);
      this.recruitmentNewsList = res.records;
      this.recruitmentTotal = res.total;
    },
    async handleReceivedCurrentChange(val) {
      this.recruitmentNewsQuery.page = val;
      // 收到投递
      const res = await receivedResumeListApi(this.recruitmentNewsQuery);
      this.recruitmentNewsList = res.records;
      this.recruitmentTotal = res.total;
    },

    // 主动下载分页方法
    async handleDownloadSizeChange(val) {
      this.downloadQuery.pageSize = val;
      // 主动下载
      const res = await downResumeListApi({
        cid: this.downloadQuery.cid,
        page: this.downloadQuery.page,
        pageSize: this.downloadQuery.pageSize,
      });
      this.downloadList = res.records;
      this.downloadTotal = res.total;
    },
    async handleDownloadCurrentChange(val) {
      this.downloadQuery.page = val;
      // 主动下载
      const res = await downResumeListApi({
        cid: this.downloadQuery.cid,
        page: this.downloadQuery.page,
        pageSize: this.downloadQuery.pageSize,
      });
      this.downloadList = res.records;
      this.downloadTotal = res.total;
    },

    // 近期查看分页方法
    async handleViewedSizeChange(val) {
      this.recentlyViewedQuery.pagesize = val;
      // 近期查看
      const res = await viewRecordISawItApi(this.recentlyViewedQuery);
      this.recentlyViewedList = res.records;
      this.recentlyViewedTotal = res.total;
    },
    async handleViewedCurrentChange(val) {
      this.recentlyViewedQuery.page = val;
      // 近期查看
      const res = await viewRecordISawItApi(this.recentlyViewedQuery);
      this.recentlyViewedList = res.records;
      this.recentlyViewedTotal = res.total;
    },

    // 职位被查看分页方法
    async handlePositionViewedSizeChange(val) {
      this.beingViewedQuery.pagesize = val;
      // 职位被查看

      const res = await viewRecorLookAtMedApi(this.beingViewedQuery);
      console.log(res);
      this.beingViewedList = res.records;
      this.beingViewedTotal = res.total;
    },
    async handlePositionViewedCurrentChange(val) {
      this.beingViewedQuery.page = val;
      // 职位被查看
      const res = await viewRecorLookAtMedApi(this.beingViewedQuery);
      console.log(res);
      this.beingViewedList = res.records;
      this.beingViewedTotal = res.total;
    },
  },
};
</script>

<style scoped lang="scss">
.table-img {
  width: 80px;
}
.shopOrder-dialog {
  height: auto;
  max-height: 600px;
  overflow-y: auto;
  .editor {
    width: 500px;
  }
}
.shopOrder-dialog::-webkit-scrollbar {
  display: none;
}
.base {
  padding: 20px 30px;
  display: flex;
  .logo {
    width: 118px;
    height: 118px;
    margin-right: 20px;
    background-color: #ebeef5;
    border: 1px solid #ebeef5;
    border-radius: 3px;
    img {
      width: 100%;
      height: 100%;
      border-radius: 3px;
    }
  }
  .info {
    flex: 1;
    .title {
      padding: 5px 0 18px;
      display: flex;
      .name {
        font-size: 20px;
        height: 20px;
        color: #303033;
        font-weight: 600;
        margin-right: 10px;
      }
      .user {
        padding-top: 6px;
        font-size: 14px;
        font-weight: 400;
        line-height: 14px;
        color: #777;
        .logoin {
          color: #0078ff;
          cursor: pointer;
        }
      }
      .qcc_box {
        width: 63px;
        height: 20px;
        position: absolute;
        right: 30px;
        z-index: 30;
        cursor: pointer;
        a {
          cursor: pointer;
          color: inherit;
          text-decoration: none;
          img {
            width: 100%;
            height: 100%;
          }
        }
      }
    }
    .details {
      max-width: 100%;
      .line {
        margin-bottom: 15px;
        .line_label {
          color: #777;
          font-size: 14px;
          line-height: 14px;
          font-weight: 400;
        }
        .text {
          display: inline-block;
          font-size: 14px;
          line-height: 14px;
        }
        .text_color {
          color: #0078ff;
          cursor: pointer;
        }
      }
    }
  }
}
.bind_icon {
  display: inline-block;
  float: left;
  margin-right: 5px;
}
.tab_box {
  padding: 0 30px;
}
.clientInfo_wrapper {
  height: calc(100vh - 246px);
  overflow-y: auto;
}
.tables {
  padding: 20px 0px;
}
.title_t {
  font-weight: 700;
  font-size: 16px;
  margin-left: 20px;
}
.table_content {
  margin-top: 30px;
}
.img_box {
  margin-top: 30px;
}

.check-box {
  padding: 15px 0 0;
  .check-list {
    margin-bottom: 15px;
    .el-checkbox-group {
      display: grid;
      -webkit-box-pack: justify;
      justify-content: space-between;
      grid-template-columns: repeat(auto-fill, 170px);
      grid-gap: 10px;
      .check-item {
        width: 170px;
        height: 230px;
        border: 1px solid #dcdfe6;
        border-radius: 4px;
        position: relative;
        .el-checkbox {
          position: absolute;
          top: 7px;
          left: 10px;

          .substring {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: #333;
            font-size: 13px;
            text-align: center;
            margin: 15px 0;
            padding: 0 31px;
            width: 170px;
            box-sizing: border-box;
            font-weight: 700;
          }
          .el-checkbox__input {
            position: absolute;
            top: 13px;
          }
        }
        .com-oprate {
          display: flex;
          -webkit-box-align: center;
          align-items: center;
          -webkit-box-pack: justify;
          justify-content: center;
          height: 40px;
          background: rgba(245, 247, 250, 0.63);
          width: 100%;
          position: absolute;
          bottom: 0;
          left: 0;
          .text {
            display: block;
            width: 33.3%;
            text-align: center;
            font-size: 12px;
            cursor: pointer;
          }
          .txt {
            position: relative;
            &::before {
              content: "";
              display: block;
              width: 1px;
              height: 12px;
              border-right: 1px solid #666;
              position: absolute;
              top: 1px;
              left: 0;
            }
            &::after {
              content: "";
              display: block;
              width: 1px;
              height: 12px;
              border-right: 1px solid #666;
              position: absolute;
              top: 1px;
              right: 0;
            }
          }
        }
        .el-image {
          position: absolute;
          top: 57px;
          right: 0;
          bottom: 0;
          left: 37px;
        }
        .com-status {
          font-size: 12px;
          color: #999;
          position: absolute;
          top: 170px;
          left: 37px;
        }
      }
    }
  }
}

.follow-wrapper {
  display: flex;
  gap: 20px;
  height: calc(100vh - 300px);
  padding: 20px;

  .follow-form {
    flex: 1;
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    overflow-y: auto;
  }

  .follow-history {
    width: 380px;
    background: #fff;
    border-radius: 4px;
    display: flex;
    flex-direction: column;

    .history-header {
      padding: 15px;
      border-bottom: 1px solid #eee;
      display: flex;
      justify-content: space-between;
      align-items: center;

      .title {
        font-weight: bold;
        font-size: 16px;
      }

      .count {
        color: #999;
        font-size: 14px;
      }
    }

    .history-list {
      flex: 1;
      overflow-y: auto;
      padding: 15px;

      .history-item {
        padding: 15px 0;
        border-bottom: 1px solid #eee;

        &:last-child {
          border-bottom: none;
        }

        .history-time {
          color: #999;
          font-size: 13px;
          margin-bottom: 10px;
        }

        .history-content {
          .history-info {
            margin-bottom: 10px;
            font-size: 14px;

            span {
              margin-right: 15px;
              color: #666;
            }
          }

          .history-result {
            font-size: 14px;
            line-height: 1.5;
            color: #333;
            margin-bottom: 10px;
          }

          .history-images {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;

            .history-image {
              width: 80px;
              height: 80px;
              border-radius: 4px;
            }
          }
        }
      }
    }
  }

  .follow-upload {
    .upload-area {
      border: 1px dashed #d9d9d9;
      border-radius: 6px;
      cursor: pointer;
      position: relative;
      text-align: center;
      padding: 20px;

      &:hover {
        border-color: #409eff;
      }

      .el-icon-upload {
        font-size: 28px;
        color: #8c939d;
        margin-bottom: 10px;
      }

      .upload-text {
        color: #606266;
        font-size: 14px;

        em {
          color: #409eff;
          font-style: normal;
        }

        .upload-tip {
          font-size: 12px;
          color: #999;
          margin-top: 5px;
        }
      }
    }
  }
}

.contact-wrapper {
  padding: 20px;
  height: calc(100vh - 300px);
  overflow-y: auto;

  .contact-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;

    .contact-item {
      background: #fff;
      border-radius: 8px;
      padding: 16px;
      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);

      .contact-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;

        .contact-name {
          font-size: 16px;
          font-weight: 500;
          color: #303133;
        }
      }

      .contact-info {
        .info-item {
          display: flex;
          align-items: center;
          margin-bottom: 8px;
          color: #606266;
          font-size: 14px;

          &:last-child {
            margin-bottom: 0;
          }

          .label {
            color: #909399;
            margin-right: 8px;
            min-width: 45px;
          }

          .phone {
            margin-right: 8px;
          }

          .social-icon {
            width: 16px;
            height: 16px;
            margin-left: 4px;
          }

          .el-icon-mobile-phone {
            font-size: 16px;
            margin-right: 8px;
            color: #409eff;
          }
        }
      }
    }
  }

  .add-contact {
    position: fixed;
    right: 40px;
    bottom: 40px;
  }
}

.jobs-wrapper {
  padding: 20px;
  height: calc(100vh - 300px);
  display: flex;
  flex-direction: column;

  .button-group {
    margin-bottom: 20px;

    .el-button {
      padding: 8px 20px;

      &.active {
        background-color: #409eff;
        color: #fff;
      }
    }
  }

  .table-container {
    flex: 1;
    overflow: auto;
    background: #fff;
    border-radius: 4px;
    padding: 20px;

    .el-table {
      margin-bottom: 20px;
    }
  }

  .pagination-container {
    // display: flex;
    // justify-content: flex-end;
    // margin-top: 20px;
    text-align: center;
  }
}

.recruitment-wrapper {
  padding: 20px;
  height: calc(100vh - 300px);
  display: flex;
  flex-direction: column;

  .button-group {
    margin-bottom: 20px;

    .el-button {
      padding: 8px 20px;

      &.active {
        background-color: #409eff;
        color: #fff;
      }
    }
  }

  .table-container {
    flex: 1;
    overflow: auto;
    background: #fff;
    border-radius: 4px;
    padding: 20px;

    .el-table {
      margin-bottom: 20px;
    }
  }

  .pagination-container {
    // display: flex;
    // justify-content: flex-end;
    margin-top: 20px;
    text-align: center;
  }
}

.orders-wrapper {
  padding: 20px;
  height: calc(100vh - 300px);
  display: flex;
  flex-direction: column;

  .filter-container {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;

    .el-select {
      width: 200px;
    }
  }

  .table-container {
    flex: 1;
    overflow: auto;
    background: #fff;
    border-radius: 4px;
    padding: 20px;

    .el-table {
      margin-bottom: 20px;
    }

    .service-info {
      display: flex;
      align-items: center;
      gap: 10px;

      .service-name {
        color: #303133;
      }
    }

    .amount {
      color: #f56c6c;
      font-weight: 500;
    }
  }

  .pagination-container {
    // display: flex;
    // justify-content: flex-end;
    margin-top: 20px;
    text-align: center;
  }
}

.logs-wrapper {
  padding: 20px;
  height: calc(100vh - 300px);
  display: flex;
  flex-direction: column;

  .filter-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .el-button {
      padding: 8px 20px;

      &.active {
        background-color: #409eff;
        color: #fff;
      }
    }

    .search-box {
      width: 250px;
    }
  }

  .table-container {
    flex: 1;
    overflow: auto;
    background: #fff;
    border-radius: 4px;
    padding: 20px;

    .el-table {
      margin-bottom: 20px;
    }
  }

  .pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;

    .total-info {
      color: #606266;
      font-size: 14px;
    }

    .page-info {
      display: flex;
      align-items: center;
      color: #606266;
      font-size: 14px;

      .jump-input {
        width: 50px;
        margin: 0 8px;
      }
    }
  }
}

.view-btn {
  color: rgb(64, 158, 255);
  cursor: pointer;
  margin-left: 5px;
}

.certification-content {
  padding: 20px;

  .status-label {
    margin-bottom: 15px;
    font-size: 14px;
    color: #606266;
  }

  .radio-group {
    margin-left: 20px;

    .el-radio {
      margin-right: 20px;
      margin-bottom: 10px;
    }
  }
}

.dialog-footer {
  text-align: right;
}
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.name {
  font-size: 16px;
  font-weight: 500;
  color: #303133;
}

.contact-item {
  margin-bottom: 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.phone {
  color: #303133;
}

.whatsapp-icon {
  color: #67c23a;
  margin-left: 8px;
  cursor: pointer;
}

.label {
  color: #909399;
  width: 45px;
}

.value {
  color: #606266;
}

.add-contact {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

:deep(.el-tag) {
  border-radius: 12px;
  padding: 0 12px;
}

:deep(.el-tag--warning) {
  background-color: #fff7e6;
  border-color: #ffd591;
  color: #fa8c16;
}

:deep(.el-tag--success) {
  background-color: #f6ffed;
  border-color: #b7eb8f;
  color: #52c41a;
}

.company-info {
  padding: 20px;
  height: calc(100vh - 246px);
  overflow-y: auto;
}

.main-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}

.section-title {
  font-size: 16px;
  font-weight: bold;
  padding-bottom: 15px;
  border-bottom: 1px solid #ebeef5;
  margin-bottom: 20px;
}

.company-form {
  max-width: 800px;
}

.logo-upload {
  text-align: center;
}

.avatar-uploader {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  width: 120px;
  height: 120px;
  display: inline-block;
}

.avatar-uploader:hover {
  border-color: #409eff;
}

.upload-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.el-icon-plus {
  font-size: 28px;
  color: #8c939d;
  margin-bottom: 8px;
}

.upload-text {
  color: #409eff;
  font-size: 14px;
  margin-bottom: 4px;
}

.upload-tip {
  color: #909399;
  font-size: 12px;
}

.avatar {
  width: 120px;
  height: 120px;
  display: block;
}

.capital-input {
  display: flex;
  align-items: center;
}

.capital-unit {
  width: 120px;
  margin-left: 10px;
}

:deep(.el-form-item__label) {
  font-weight: normal;
}

:deep(.el-form-item__label::before) {
  content: "*";
  color: #f56c6c;
  margin-right: 4px;
}

:deep(.el-radio) {
  margin-right: 30px;
}

:deep(.el-select) {
  width: 100%;
}

:deep(.el-input__inner) {
  height: 40px;
  line-height: 40px;
}

.button-group {
  margin-bottom: 20px;
}

.tags-container {
  width: 410px;
  padding: 4px 11px;
  background-color: #f5f7fa;
  border-radius: 4px;
  min-height: 32px;
  border: 1px solid #dcdfe6;
}

.pagination-container {
  text-align: center;
}

.tags-container {
  display: flex;
  align-items: center;
}

.clear-btn {
  color: #409eff;
  margin-left: 10px;
}

/* 添加PDF预览容器样式 */
iframe {
  max-width: 100%;
  margin: 0 auto;
  display: block;
}
</style>
